summaryrefslogtreecommitdiff
path: root/tests/schema/models.py
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2013-08-19 13:50:26 +0100
committerAndrew Godwin <andrew@aeracode.org>2013-08-19 13:50:26 +0100
commit52edc16086e3c28a78c31975bb4da2f9450590b4 (patch)
treef25fa23a93904aba0258ec85c5d3712e0fa381e3 /tests/schema/models.py
parent5b522cd85a63cf5e352c500447aa91002e83845e (diff)
downloaddjango-52edc16086e3c28a78c31975bb4da2f9450590b4.tar.gz
Add more stringent M2M tests and fix the bug they exposed
Diffstat (limited to 'tests/schema/models.py')
-rw-r--r--tests/schema/models.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/schema/models.py b/tests/schema/models.py
index 69cf06f3c4..dc717ec105 100644
--- a/tests/schema/models.py
+++ b/tests/schema/models.py
@@ -37,7 +37,7 @@ class BookWithM2M(models.Model):
author = models.ForeignKey(Author)
title = models.CharField(max_length=100, db_index=True)
pub_date = models.DateTimeField()
- tags = models.ManyToManyField("Tag", related_name="books")
+ tags = models.ManyToManyField("TagM2MTest", related_name="books")
class Meta:
app_cache = new_app_cache
@@ -62,6 +62,14 @@ class Tag(models.Model):
app_cache = new_app_cache
+class TagM2MTest(models.Model):
+ title = models.CharField(max_length=255)
+ slug = models.SlugField(unique=True)
+
+ class Meta:
+ app_cache = new_app_cache
+
+
class TagIndexed(models.Model):
title = models.CharField(max_length=255)
slug = models.SlugField(unique=True)