summaryrefslogtreecommitdiff
path: root/tests/serializers
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2020-04-07 10:54:19 +0200
committerGitHub <noreply@github.com>2020-04-07 10:54:19 +0200
commitcf21fc9bf010c71385dbead215d26151fb70d2ad (patch)
treed617985fb81e569ff6d654be50bb54a1c522cbab /tests/serializers
parent678f958ef972bf9be402332537149ca0884035ba (diff)
Enforced uniqueness of natural keys used in tests.
Diffstat (limited to 'tests/serializers')
-rw-r--r--tests/serializers/models/natural.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/serializers/models/natural.py b/tests/serializers/models/natural.py
index 8f0bc48648..88bfed566b 100644
--- a/tests/serializers/models/natural.py
+++ b/tests/serializers/models/natural.py
@@ -24,7 +24,7 @@ class FKDataNaturalKey(models.Model):
class NaturalKeyThing(models.Model):
- key = models.CharField(max_length=100)
+ key = models.CharField(max_length=100, unique=True)
other_thing = models.ForeignKey('NaturalKeyThing', on_delete=models.CASCADE, null=True)
other_things = models.ManyToManyField('NaturalKeyThing', related_name='thing_m2m_set')