On Wednesday 22 February 2017 14:22:36 'Tom Evans' via Django users wrote: > On Wed, Feb 22, 2017 at 12:47 AM, Melvyn Sopacua <m.r.sopa...@gmail.com> wrote: > > On Tuesday 21 February 2017 19:00:42 'Tom Evans' via Django users wrote:
> >> What is the "correct" way of ensuring that these instances exist in > >> > >> the test database before any test is run? > > > > All explained in the docs. > > > > Either redeclare the same fixtures for different test cases or > > reorganize your testcases to share the same fixture(s). > > I think you have misunderstood: > > 1) The test cases belong to a library and cannot be modified So don't use them as is or prompt the authors to update to the new way of things. In transition, you can extend the test cases and simply add a fixture attribute. > 2) The initial data is populated from a data migration and not from a > fixture, as that is not recommended [1] Data migrations for the project are never relevant for tests, since the test database is empty. You're putting a label on "fixtures" that is only relevant for the provided context. Fixtures are not deprecated, not bad for you and do not mess up your aura. On one hand It is as Adam says: " It would seem to me that the docs are telling you to use fixtures for tests and use migrations for real data." Adding to that - fixtures are still a solid way to load application data - only the use of "initial" or "autloaded" data is discouraged. Fixtures should be used on production databases to selectively provide data, so that the user of the application can load "google_shopping.json" if it wants to publish it's products Google Shopping or not load it, if she doesn't. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/148821513.UZqiaWgqFf%40devstation. For more options, visit https://groups.google.com/d/optout.