summaryrefslogtreecommitdiff
path: root/tests/get_or_create/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/get_or_create/tests.py')
-rw-r--r--tests/get_or_create/tests.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/get_or_create/tests.py b/tests/get_or_create/tests.py
index a2821187b2..aa68d41c00 100644
--- a/tests/get_or_create/tests.py
+++ b/tests/get_or_create/tests.py
@@ -12,6 +12,7 @@ from .models import (
Author,
Book,
DefaultPerson,
+ Journalist,
ManualPrimaryKeyTest,
Person,
Profile,
@@ -503,6 +504,15 @@ class UpdateOrCreateTests(TestCase):
)
self.assertFalse(created)
+ def test_mti_update_non_local_concrete_fields(self):
+ journalist = Journalist.objects.create(name="Jane", specialty="Politics")
+ journalist, created = Journalist.objects.update_or_create(
+ pk=journalist.pk,
+ defaults={"name": "John"},
+ )
+ self.assertIs(created, False)
+ self.assertEqual(journalist.name, "John")
+
class UpdateOrCreateTestsWithManualPKs(TestCase):
def test_create_with_duplicate_primary_key(self):