summaryrefslogtreecommitdiff
path: root/tests/djapp
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2015-05-31 10:47:28 +0100
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2015-05-31 10:47:28 +0100
commit0b5270eab393fad20faa7a6a9720af18c97b1773 (patch)
treede32d3300256be1bfc8626361970efa32b133ce5 /tests/djapp
parente9851a7d51afffea2a5679934ad6284c0835cfa2 (diff)
downloadfactory-boy-0b5270eab393fad20faa7a6a9720af18c97b1773.tar
factory-boy-0b5270eab393fad20faa7a6a9720af18c97b1773.tar.gz
Properly handle custom Django managers (Closes #201).
The actual behavior of Django with custom managers and inherited abstract models is rather complex, so this had to be adapted to the actual Django source code.
Diffstat (limited to 'tests/djapp')
-rw-r--r--tests/djapp/models.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/djapp/models.py b/tests/djapp/models.py
index 68b9709..cadefbc 100644
--- a/tests/djapp/models.py
+++ b/tests/djapp/models.py
@@ -110,3 +110,14 @@ class WithCustomManager(models.Model):
foo = models.CharField(max_length=20)
objects = CustomManager()
+
+
+class AbstractWithCustomManager(models.Model):
+ custom_objects = CustomManager()
+
+ class Meta:
+ abstract = True
+
+
+class FromAbstractWithCustomManager(AbstractWithCustomManager):
+ pass