#25290: Inconsistency between database and object instances when using
setUpTestData with related objects
-----------------------------------+--------------------------------------
     Reporter:  MarkusH            |                    Owner:  nobody
         Type:  Bug                |                   Status:  new
    Component:  Testing framework  |                  Version:  1.8
     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 MarkusH):

 Yeah, I see that. The "solution" I came up with now is

 {{{#!python
 def test_2(self):
     try:
         with self.assertRaisesRegex(IntegrityError, 'app_obj_name_key'):
             Obj.objects.create(relobj=self.relobj, name='foo', val=2)
     finally:
         self.relobj = self.obj
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25290#comment:2>
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/065.973967488c16440994eeb14ab8809074%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to