Ticket #25296: 25296-test.diff

File 25296-test.diff, 789 bytes (added by Tim Graham, 9 years ago)
  • tests/one_to_one/tests.py

    diff --git a/tests/one_to_one/tests.py b/tests/one_to_one/tests.py
    index b71ee06..cdc9c34 100644
    a b class OneToOneTests(TestCase):  
    135135        should raise an exception.
    136136        """
    137137        place = Place(name='User', address='London')
     138        self.assertRaises(Restaurant.DoesNotExist, lambda: place.restaurant)
    138139        msg = "save() prohibited to prevent data loss due to unsaved related object 'place'."
    139140        with self.assertRaisesMessage(ValueError, msg):
    140141            Restaurant.objects.create(place=place, serves_hot_dogs=True, serves_pizza=False)
     142        self.assertRaises(Restaurant.DoesNotExist, lambda: place.restaurant)
    141143
    142144    def test_reverse_relationship_cache_cascade(self):
    143145        """
Back to Top