from django.test import SimpleTestCase
from django.db.models import F
from django.core.exceptions import FieldError

from .models import Article


class BogusLookup(SimpleTestCase):
    def test_bogus_lookup(self):
        with self.assertRaises(FieldError):
            Article.objects.annotate(spam=F('author__foo'))
