diff --git tests/regressiontests/loaddata/__init__.py tests/regressiontests/loaddata/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git tests/regressiontests/loaddata/fixtures/relative.json tests/regressiontests/loaddata/fixtures/relative.json
new file mode 100644
index 0000000..0a626d9
-
|
+
|
|
| 1 | [ |
| 2 | { |
| 3 | "pk": "1", |
| 4 | "model": "loaddata.relative", |
| 5 | "fields": { |
| 6 | "name": "Load Relative Path Test" |
| 7 | } |
| 8 | } |
| 9 | ] |
diff --git tests/regressiontests/loaddata/models/__init__.py tests/regressiontests/loaddata/models/__init__.py
new file mode 100644
index 0000000..0cd8b48
-
|
+
|
|
| 1 | from django.db import models |
| 2 | from django.contrib.auth.models import User |
| 3 | from django.conf import settings |
| 4 | import os |
| 5 | |
| 6 | class Relative(models.Model): |
| 7 | name = models.CharField(max_length=40) |
| 8 | |
| 9 | load_count = 0 |
| 10 | |
| 11 | def __init__(self, *args, **kwargs): |
| 12 | super(Relative, self).__init__(*args, **kwargs) |
| 13 | Relative.load_count += 1 |
| 14 | |
| 15 | # Models to regresison check #7572 |
| 16 | class Channel(models.Model): |
| 17 | name = models.CharField(max_length=255) |
| 18 | |
| 19 | class Article(models.Model): |
| 20 | title = models.CharField(max_length=255) |
| 21 | channels = models.ManyToManyField(Channel) |
| 22 | |
| 23 | class Meta: |
| 24 | ordering = ('id',) |
| 25 | |
| 26 | __test__ = {'API_TESTS':""" |
| 27 | >>> from django.core import management |
| 28 | |
| 29 | >>> management.call_command('loaddata', 'relative', verbosity=0) |
| 30 | >>> Relative.load_count |
| 31 | 1 |
| 32 | |
| 33 | """} |