#23640: StaticLiveServerTestCase does not properly respect data migrations
----------------------------+----------------------------------------------
     Reporter:  eldamir     |      Owner:  nobody
         Type:  Bug         |     Status:  new
    Component:  Testing     |    Version:  1.7
  framework                 |   Keywords:  data migration, functional tests
     Severity:  Normal      |  Has patch:  0
 Triage Stage:  Unreviewed  |      UI/UX:  0
Easy pickings:  0           |
----------------------------+----------------------------------------------
 When data migrations exists for a project, it is expected that each test
 case has these migrations run before running the test.
 That is indeed the case for django.tests.TestCase (unit tests), but it is
 NOT working for
 django.contrib.staticfiles.testing.StaticLiveServerTestCase (functional
 tests).

 Migrations seem to be run for each class, e.g.
 MyTestCase(StaticLiveServerTestCase), but not for the methods of this
 class. That is, if MyTestCase has 3 methods with tests, the migrations are
 only loaded for the first one, and then the database is wiped, and the
 objects from the data migration is no longer present for the next two
 methods.

 A minimal reproduction of this issue - along with a guide to the issue and
 which files to look at - can be found here:
 https://github.com/eldamir/django_migration_bug

--
Ticket URL: <https://code.djangoproject.com/ticket/23640>
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/050.5d47736bf75a1e055a48310fcda7ea9c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to