summaryrefslogtreecommitdiff
path: root/tests/basic/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basic/tests.py')
-rw-r--r--tests/basic/tests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/basic/tests.py b/tests/basic/tests.py
index 342c39ea34..b3bb4d02cc 100644
--- a/tests/basic/tests.py
+++ b/tests/basic/tests.py
@@ -649,6 +649,12 @@ class ModelRefreshTests(TestCase):
with self.assertRaisesMessage(TypeError, msg):
s.refresh_from_db(unknown_kwarg=10)
+ def test_lookup_in_fields(self):
+ s = SelfRef.objects.create()
+ msg = 'Found "__" in fields argument. Relations and transforms are not allowed in fields.'
+ with self.assertRaisesMessage(ValueError, msg):
+ s.refresh_from_db(fields=['foo__bar'])
+
def test_refresh_fk(self):
s1 = SelfRef.objects.create()
s2 = SelfRef.objects.create()