#20483: Reduce the set of apps seen by individual tests --------------------------------------+------------------------------------ Reporter: akaariai | Owner: nobody Type: Cleanup/optimization | Status: new Component: Testing framework | Version: master Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 1 Easy pickings: 0 | UI/UX: 0 --------------------------------------+------------------------------------
Comment (by aaugustin): I updated my pull request (https://github.com/django/django/pull/1240) as follows: - I simplified the behavior and minimized changes by removing everything that isn't strictly necessary. - I updated `available_apps` declarations, since the current application isnt' implicitly included any longer. - I refactored the changes to the app cache, `AppCache.available_apps` is now a set of app labels, and I added `unset_available_apps()` which looks slightly better than `set_available_apps(None)`. - I added documentation: the API is still explicitly described as private and not subject to the deprecation policy, but it's explained for contributors and committers. Tests pass under SQLite, I'm stumbling on the same problem as Anssi: `flush` fails on PostgreSQL. I see two possibilities: - use `TRUNCATE .. CASCADE` -- since this happens on the test database, and isn't recommended outside of Django's test suite, I'm not too concerned about cascading to unmanaged models and destroying data. - use `DELETE FROM ...` instead of `TRUNCATE ...` -- this needs a benchmark. Either solution requires a non-trivial amount of changes :( -- Ticket URL: <https://code.djangoproject.com/ticket/20483#comment:28> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.e08d6bcc0480590ed0957bccc3ba022d%40djangoproject.com?hl=en. For more options, visit https://groups.google.com/groups/opt_out.