#20579: Define the expected state of the database between test cases -----------------------------------+------------------------------------- Reporter: aaugustin | Owner: aaugustin Type: Bug | Status: new Component: Testing framework | Version: master Severity: Release blocker | Resolution: Keywords: | Triage Stage: Accepted Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -----------------------------------+-------------------------------------
Comment (by akaariai): I think the patch is OK. Though the setup/teardown for TXTestCase is getting a bit complex... In the long term it might be better to do some test class reordering: run first TestCases, then TransactionTestCases, do a flush + reload, and then run the rest. This would mean that TXTestCase really has an empty db at the start of the run, and that the rest of tests start running with properly filled database. To me it seems the ultimate solution is to do the flush + data reloading not as part of test case, but as an intermediary step done by the testing code. The TestCase class has visibility to both the previous and next test and could maybe do some more intelligent reloading based on that information. I don't know if this is easy or even possible to do. -- Ticket URL: <https://code.djangoproject.com/ticket/20579#comment:3> 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/067.d1e64312fa499170b987e9740ca1c2a0%40djangoproject.com?hl=en. For more options, visit https://groups.google.com/groups/opt_out.