summaryrefslogtreecommitdiff
path: root/tests/fixtures_model_package
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2014-12-26 13:23:38 -0500
committerTim Graham <timograham@gmail.com>2015-01-17 09:59:25 -0500
commit67235fd4ef1b006fc9cdb2fa20e7bb93b0edff4b (patch)
tree7f2cf7cac4185235e3f066caf9ae5854f0f75bdb /tests/fixtures_model_package
parentf635d759354842e46901ed1ae1be5f5a0b81e567 (diff)
downloaddjango-67235fd4ef1b006fc9cdb2fa20e7bb93b0edff4b.tar.gz
Removed support for initial_data fixtures per deprecation timeline.
Diffstat (limited to 'tests/fixtures_model_package')
-rw-r--r--tests/fixtures_model_package/fixtures/initial_data.json9
-rw-r--r--tests/fixtures_model_package/tests.py49
2 files changed, 2 insertions, 56 deletions
diff --git a/tests/fixtures_model_package/fixtures/initial_data.json b/tests/fixtures_model_package/fixtures/initial_data.json
deleted file mode 100644
index 1d1cf15e03..0000000000
--- a/tests/fixtures_model_package/fixtures/initial_data.json
+++ /dev/null
@@ -1,9 +0,0 @@
-[
- {
- "pk": "10",
- "model": "fixtures_model_package.book",
- "fields": {
- "name": "Achieving self-awareness of Python programs"
- }
- }
-]
diff --git a/tests/fixtures_model_package/tests.py b/tests/fixtures_model_package/tests.py
index fd48dc1f9c..431bf8fa47 100644
--- a/tests/fixtures_model_package/tests.py
+++ b/tests/fixtures_model_package/tests.py
@@ -3,11 +3,10 @@ from __future__ import unicode_literals
import warnings
from django.core import management
-from django.db import transaction
-from django.test import TestCase, TransactionTestCase
+from django.test import TestCase
from django.utils.six import StringIO
-from .models import Article, Book
+from .models import Article
class SampleTestCase(TestCase):
@@ -26,51 +25,7 @@ class SampleTestCase(TestCase):
)
-class TestNoInitialDataLoading(TransactionTestCase):
-
- available_apps = ['fixtures_model_package']
-
- def test_migrate(self):
- with transaction.atomic():
- Book.objects.all().delete()
-
- management.call_command(
- 'migrate',
- verbosity=0,
- load_initial_data=False
- )
- self.assertQuerysetEqual(Book.objects.all(), [])
-
- def test_flush(self):
- # Test presence of fixture (flush called by TransactionTestCase)
- self.assertQuerysetEqual(
- Book.objects.all(), [
- 'Achieving self-awareness of Python programs'
- ],
- lambda a: a.name
- )
-
- with transaction.atomic():
- management.call_command(
- 'flush',
- verbosity=0,
- interactive=False,
- load_initial_data=False
- )
- self.assertQuerysetEqual(Book.objects.all(), [])
-
-
class FixtureTestCase(TestCase):
- def test_initial_data(self):
- "Fixtures can load initial data into models defined in packages"
- # migrate introduces 1 initial data object from initial_data.json
- # this behavior is deprecated and will be removed in Django 1.9
- self.assertQuerysetEqual(
- Book.objects.all(), [
- 'Achieving self-awareness of Python programs'
- ],
- lambda a: a.name
- )
def test_loaddata(self):
"Fixtures can load data into models defined in packages"