diff -r f886ea8cfadf tests/regressiontests/model_package_regress/__init__.py
diff -r f886ea8cfadf tests/regressiontests/model_package_regress/models/__init__.py
-
|
+
|
|
| 1 | # Import all the models from subpackages |
| 2 | from article import Article, Publication |
diff -r f886ea8cfadf tests/regressiontests/model_package_regress/models/article.py
-
|
+
|
|
| 1 | from django.db import models |
| 2 | |
| 3 | class Publication(models.Model): |
| 4 | title = models.CharField(max_length=30) |
| 5 | |
| 6 | class Meta: |
| 7 | app_label = 'model_package_regress' |
| 8 | |
| 9 | |
| 10 | class Article(models.Model): |
| 11 | headline = models.CharField(max_length=100) |
| 12 | publications = models.ManyToManyField(Publication, null=True, blank=True,) |
| 13 | |
| 14 | class Meta: |
| 15 | app_label = 'model_package_regress' |
diff -r f886ea8cfadf tests/regressiontests/model_package_regress/tests.py
-
|
+
|
|
| 1 | #from django.db import models |
| 2 | |
| 3 | __test__ = {'API_TESTS': """ |
| 4 | >>> from models.article import Article, Publication |
| 5 | |
| 6 | >>> Publication._meta.db_table |
| 7 | 'model_package_regress_publication' |
| 8 | |
| 9 | >>> Article._meta.db_table |
| 10 | 'model_package_regress_article' |
| 11 | |
| 12 | >>> for f in Article._meta.local_many_to_many: |
| 13 | ... if f.name == 'publications': |
| 14 | ... break |
| 15 | |
| 16 | >>> f.m2m_db_table() |
| 17 | 'model_package_regress_article_publications' |
| 18 | |
| 19 | >>> f.m2m_column_name() |
| 20 | 'article_id' |
| 21 | |
| 22 | >>> f.m2m_reverse_name() |
| 23 | 'publication_id' |
| 24 | |
| 25 | """} |
| 26 | |
| 27 | |