From 67235fd4ef1b006fc9cdb2fa20e7bb93b0edff4b Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 26 Dec 2014 13:23:38 -0500 Subject: Removed support for initial_data fixtures per deprecation timeline. --- .../fixtures/initial_data.json | 9 ---- tests/fixtures_model_package/tests.py | 49 +--------------------- 2 files changed, 2 insertions(+), 56 deletions(-) delete mode 100644 tests/fixtures_model_package/fixtures/initial_data.json (limited to 'tests/fixtures_model_package') 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" -- cgit v1.3