#24241: state.clone doesn't copy Django models
----------------------------+--------------------------------------
     Reporter:  claudep     |                    Owner:  nobody
         Type:  Bug         |                   Status:  new
    Component:  Migrations  |                  Version:  1.8alpha1
     Severity:  Normal      |               Resolution:
     Keywords:              |             Triage Stage:  Unreviewed
    Has patch:  0           |      Needs documentation:  0
  Needs tests:  0           |  Patch needs improvement:  0
Easy pickings:  0           |                    UI/UX:  0
----------------------------+--------------------------------------

Comment (by claudep):

 Test to reproduce the problem:
 {{{
 #!diff
 diff --git a/tests/migrations/test_state.py
 b/tests/migrations/test_state.py
 index a7dbdbe..af440b9 100644
 --- a/tests/migrations/test_state.py
 +++ b/tests/migrations/test_state.py
 @@ -381,11 +381,18 @@ class StateTests(TestCase):
              {},
              None,
          ))
 +        project_state.apps  # Fill the apps cached property
 +        import pdb; pdb.set_trace()
          other_state = project_state.clone()
          self.assertEqual(project_state, project_state)
          self.assertEqual(project_state, other_state)
          self.assertEqual(project_state != project_state, False)
          self.assertEqual(project_state != other_state, False)
 +        self.assertNotEqual(project_state.apps, other_state.apps)
 +        self.assertNotEqual(
 +            project_state.apps.get_model('migrations', 'tag'),
 +            other_state.apps.get_model('migrations', 'tag')
 +        )

          # Make a very small change (max_len 99) and see if that affects
 it
          project_state = ProjectState()
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24241#comment:1>
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/065.4f5088854481d3a47f2ab858677a6104%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to