mirror of https://github.com/django/django.git
Moved test for nonexistent field in F() to BasicExpressionsTest.
This commit is contained in:
parent
570402ffd7
commit
aa16ec5474
|
@ -591,6 +591,10 @@ class BasicExpressionsTests(TestCase):
|
||||||
expr.convert_value # populate cached property
|
expr.convert_value # populate cached property
|
||||||
self.assertEqual(pickle.loads(pickle.dumps(expr)), expr)
|
self.assertEqual(pickle.loads(pickle.dumps(expr)), expr)
|
||||||
|
|
||||||
|
def test_incorrect_field_in_F_expression(self):
|
||||||
|
with self.assertRaisesMessage(FieldError, "Cannot resolve keyword 'nope' into field."):
|
||||||
|
list(Employee.objects.filter(firstname=F('nope')))
|
||||||
|
|
||||||
|
|
||||||
class IterableLookupInnerExpressionsTests(TestCase):
|
class IterableLookupInnerExpressionsTests(TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -922,10 +926,6 @@ class ExpressionsNumericTests(TestCase):
|
||||||
self.assertEqual(Number.objects.get(pk=n.pk).integer, 10)
|
self.assertEqual(Number.objects.get(pk=n.pk).integer, 10)
|
||||||
self.assertEqual(Number.objects.get(pk=n.pk).float, Approximate(256.900, places=3))
|
self.assertEqual(Number.objects.get(pk=n.pk).float, Approximate(256.900, places=3))
|
||||||
|
|
||||||
def test_incorrect_field_expression(self):
|
|
||||||
with self.assertRaisesMessage(FieldError, "Cannot resolve keyword 'nope' into field."):
|
|
||||||
list(Employee.objects.filter(firstname=F('nope')))
|
|
||||||
|
|
||||||
|
|
||||||
class ExpressionOperatorTests(TestCase):
|
class ExpressionOperatorTests(TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
Loading…
Reference in New Issue