diff options
| author | Alexander Holmbäck <alexande.holmback@creuna.se> | 2018-09-05 21:22:10 +0000 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-09-08 09:40:53 -0400 |
| commit | ed60ce55c2dd8a3940fa5ae9f1622f101c8421ad (patch) | |
| tree | 0d438ece15f11b9b9dcb066a9e95b08e530cb7f6 | |
| parent | 2975ceef6c9f459f1f5ea31f45aceead919cb0bd (diff) | |
[2.1.x] Moved test for nonexistent field in F() to BasicExpressionsTest.
Backport of aa16ec54747eaa9da7534e67a1de320b9a517c1c from master
| -rw-r--r-- | tests/expressions/tests.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/expressions/tests.py b/tests/expressions/tests.py index d1e622a2d4..973176e223 100644 --- a/tests/expressions/tests.py +++ b/tests/expressions/tests.py @@ -591,6 +591,10 @@ class BasicExpressionsTests(TestCase): expr.convert_value # populate cached property 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): @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).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): @classmethod |
