#22487: Moving from initial_data to data migrations stops test data persisting
-------------------------------------+-------------------------------------
     Reporter:  andrewgodwin         |                    Owner:
         Type:  Bug                  |  andrewgodwin
    Component:  Testing framework    |                   Status:  closed
     Severity:  Release blocker      |                  Version:
     Keywords:                       |  1.7-beta-1
    Has patch:  0                    |               Resolution:  fixed
  Needs tests:  0                    |             Triage Stage:  Accepted
Easy pickings:  0                    |      Needs documentation:  0
                                     |  Patch needs improvement:  0
                                     |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by RafalP):

 Running commit db9cb83d2fec781f6479f19b63d50b44a35ae632, I can't say this
 is fixed:

 ======================================================================
 ERROR: test_root_category
 (misago.forums.tests.test_forum_model.ForumManagerTests)
 root_category returns forums tree root
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File
 "/Users/rafapiton/Documents/misago/misago/forums/tests/test_forum_model.py",
 line 15, in test_root_category
     forum = Forum.objects.root_category()
   File "/Users/rafapiton/Documents/misago/misago/forums/models.py", line
 19, in root_category
     return self.get(special_role='root_category')
   File "/Users/rafapiton/venvs/misago06/lib/python2.7/site-
 packages/django/db/models/manager.py", line 92, in manager_method
     return getattr(self.get_queryset(), name)(*args, **kwargs)
   File "/Users/rafapiton/venvs/misago06/lib/python2.7/site-
 packages/django/db/models/query.py", line 355, in get
     self.model._meta.object_name)
 DoesNotExist: Forum matching query does not exist.

 There is DB migration in place that creates forums tree. When I run
 "manage.py migrate", DB is created correctly. When I put debug code in my
 migration to raise Exception() with .count() for
 apps.get_model('misago_forums', 'Forum"), it returns valid number (5
 forums), however as soon as test tries to reach to this table, its empty.
 I've included similiar code at beginning of test, this time exception
 returns 0.

 I am running tests on Postgres 9.3:

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22487#comment:20>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.ffa0c62e421690d0aff02e5c4d7492b7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to