summaryrefslogtreecommitdiff
path: root/tests/model_inheritance/same_model_name
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2014-04-21 11:41:30 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2014-04-21 11:43:38 +0200
commitab0afef9590730064d40ca074c3b2be3baebf9cb (patch)
tree23722be7819c1a06abe63fe9ffd88f4d4a2cc6e6 /tests/model_inheritance/same_model_name
parent33d1dc2eeb5db83f07b6b7fbf3b10ef01b74702b (diff)
[1.7.x] Fixed #22402 -- Consolidated model_inheritance tests.
The model_inheritance_same_model_name tests couldn't be run without the model_inheritance tests. Make the problem go away by merging them. Thanks timo for the report. Backport of 0097d38 from master
Diffstat (limited to 'tests/model_inheritance/same_model_name')
-rw-r--r--tests/model_inheritance/same_model_name/__init__.py0
-rw-r--r--tests/model_inheritance/same_model_name/models.py19
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/model_inheritance/same_model_name/__init__.py b/tests/model_inheritance/same_model_name/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/model_inheritance/same_model_name/__init__.py
diff --git a/tests/model_inheritance/same_model_name/models.py b/tests/model_inheritance/same_model_name/models.py
new file mode 100644
index 0000000000..307a505ee6
--- /dev/null
+++ b/tests/model_inheritance/same_model_name/models.py
@@ -0,0 +1,19 @@
+"""
+
+Model inheritance across apps can result in models with the same name,
+requiring an %(app_label)s format string. This app tests this feature by
+redefining the Copy model from model_inheritance/models.py.
+"""
+
+from django.db import models
+
+from model_inheritance.models import NamedURL
+from django.utils.encoding import python_2_unicode_compatible
+
+
+@python_2_unicode_compatible
+class Copy(NamedURL):
+ content = models.TextField()
+
+ def __str__(self):
+ return self.content