Ticket #29727: test_bogus_lookup.py
| File test_bogus_lookup.py, 319 bytes (added by , 8 years ago) |
|---|
| Line | |
|---|---|
| 1 | from django.test import SimpleTestCase |
| 2 | from django.db.models import F |
| 3 | from django.core.exceptions import FieldError |
| 4 | |
| 5 | from .models import Article |
| 6 | |
| 7 | |
| 8 | class BogusLookup(SimpleTestCase): |
| 9 | def test_bogus_lookup(self): |
| 10 | with self.assertRaises(FieldError): |
| 11 | Article.objects.annotate(spam=F('author__foo')) |