1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #26620 -- Made Model.refresh_from_db() fail when passed unknown kwargs.

This commit is contained in:
Marti Raudsepp
2016-05-16 21:49:03 +03:00
committed by Tim Graham
parent a5c8072ab1
commit b9ae662c97
3 changed files with 7 additions and 2 deletions

View File

@@ -690,6 +690,11 @@ class ModelRefreshTests(TestCase):
a.refresh_from_db()
self.assertEqual(a.pub_date, new_pub_date)
def test_unknown_kwarg(self):
s = SelfRef.objects.create()
with self.assertRaises(TypeError):
s.refresh_from_db(unknown_kwarg=10)
def test_refresh_fk(self):
s1 = SelfRef.objects.create()
s2 = SelfRef.objects.create()