summaryrefslogtreecommitdiff
path: root/tests/regressiontests/admin_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/regressiontests/admin_scripts')
-rw-r--r--tests/regressiontests/admin_scripts/app_with_import/__init__.py0
-rw-r--r--tests/regressiontests/admin_scripts/app_with_import/models.py7
-rw-r--r--tests/regressiontests/admin_scripts/tests.py9
3 files changed, 16 insertions, 0 deletions
diff --git a/tests/regressiontests/admin_scripts/app_with_import/__init__.py b/tests/regressiontests/admin_scripts/app_with_import/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/regressiontests/admin_scripts/app_with_import/__init__.py
diff --git a/tests/regressiontests/admin_scripts/app_with_import/models.py b/tests/regressiontests/admin_scripts/app_with_import/models.py
new file mode 100644
index 0000000000..06ca0e8a34
--- /dev/null
+++ b/tests/regressiontests/admin_scripts/app_with_import/models.py
@@ -0,0 +1,7 @@
+from django.contrib.comments.models import Comment
+from django.db import models
+
+# Regression for #13368. This is an example of a model
+# that imports a class that has an abstract base class.
+class CommentScore(models.Model):
+ comment = models.OneToOneField(Comment, primary_key=True)
diff --git a/tests/regressiontests/admin_scripts/tests.py b/tests/regressiontests/admin_scripts/tests.py
index d8c8e1e7b2..7ec2454561 100644
--- a/tests/regressiontests/admin_scripts/tests.py
+++ b/tests/regressiontests/admin_scripts/tests.py
@@ -987,6 +987,15 @@ class ManageValidate(AdminScriptTestCase):
self.assertNoOutput(err)
self.assertOutput(out, '0 errors found')
+ def test_app_with_import(self):
+ "manage.py validate does not raise errors when an app imports a base class that itself has an abstract base"
+ self.write_settings('settings.py',
+ apps=['admin_scripts.app_with_import', 'django.contrib.comments'],
+ sdict={'DEBUG': True})
+ args = ['validate']
+ out, err = self.run_manage(args)
+ self.assertNoOutput(err)
+ self.assertOutput(out, '0 errors found')
##########################################################################
# COMMAND PROCESSING TESTS