Skip to content

Commit

Permalink
Add a failed test case for #348
Browse files Browse the repository at this point in the history
  • Loading branch information
Suor committed Oct 25, 2020
1 parent a4a1234 commit 07e702f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,17 @@ def test_312(self):
def test_316(self):
Category.objects.cache().annotate(num=Count('posts')).aggregate(total=Sum('num'))

@unittest.expectedFailure
def test_348(self):
foo = Foo.objects.create()
bar = Bar.objects.create(foo=foo)

bar = Bar.objects.cache().get(pk=bar.pk)
bar.foo.delete()

bar = Bar.objects.cache().get(pk=bar.pk)
bar.foo # fails here since we try to fetch Foo instance by cached id

def test_352(self):
CombinedFieldModel.objects.create()
list(CombinedFieldModel.objects.cache().all())
Expand Down

0 comments on commit 07e702f

Please sign in to comment.