summaryrefslogtreecommitdiff
path: root/tests/base
diff options
context:
space:
mode:
authorFlorian Apolloner <florian@apolloner.eu>2013-02-26 09:53:47 +0100
committerFlorian Apolloner <florian@apolloner.eu>2013-02-26 14:36:57 +0100
commit89f40e36246100df6a11316c31a76712ebc6c501 (patch)
tree6e65639683ddaf2027908d1ecb1739e0e2ff853b /tests/base
parentb3d2ccb5bfbaf6e7fe1f98843baaa48c35a70950 (diff)
downloaddjango-89f40e36246100df6a11316c31a76712ebc6c501.tar.gz
Merged regressiontests and modeltests into the test root.
Diffstat (limited to 'tests/base')
-rw-r--r--tests/base/__init__.py0
-rw-r--r--tests/base/models.py23
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/base/__init__.py b/tests/base/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/base/__init__.py
diff --git a/tests/base/models.py b/tests/base/models.py
new file mode 100644
index 0000000000..bddb406820
--- /dev/null
+++ b/tests/base/models.py
@@ -0,0 +1,23 @@
+from __future__ import unicode_literals
+
+from django.db import models
+from django.utils import six
+
+
+# The models definitions below used to crash. Generating models dynamically
+# at runtime is a bad idea because it pollutes the app cache. This doesn't
+# integrate well with the test suite but at least it prevents regressions.
+
+
+class CustomBaseModel(models.base.ModelBase):
+ pass
+
+
+class MyModel(six.with_metaclass(CustomBaseModel, models.Model)):
+ """Model subclass with a custom base using six.with_metaclass."""
+
+
+if not six.PY3:
+ class MyModel(models.Model):
+ """Model subclass with a custom base using __metaclass__."""
+ __metaclass__ = CustomBaseModel