Ticket #24418: 24418-test.diff

File 24418-test.diff, 647 bytes (added by Tim Graham, 10 years ago)
  • tests/basic/tests.py

    diff --git a/tests/basic/tests.py b/tests/basic/tests.py
    index 53efba3..409c673 100644
    a b class ModelRefreshTests(TestCase):  
    736736            self.assertFalse(hasattr(s3_copy.selfref, 'touched'))
    737737            self.assertEqual(s3_copy.selfref, s2)
    738738
     739    def test_refresh_null_fk(self):
     740        s1 = SelfRef.objects.create()
     741        s2 = SelfRef.objects.create(selfref=s1)
     742        s2.selfref = None
     743        s2.refresh_from_db()
     744
    739745    def test_refresh_unsaved(self):
    740746        pub_date = self._truncate_ms(datetime.now())
    741747        a = Article.objects.create(pub_date=pub_date)
Back to Top