diff --git tests/modeltests/fixtures_model_package/tests.py tests/modeltests/fixtures_model_package/tests.py
index 4da2069..0cc9038 100644
|
|
class SampleTestCase(TestCase):
|
20 | 20 | ) |
21 | 21 | |
22 | 22 | |
| 23 | class TestNoInitialDataLoading(TestCase): |
| 24 | def test_syncdb(self): |
| 25 | Book.objects.all().delete() |
| 26 | |
| 27 | management.call_command( |
| 28 | 'syncdb', |
| 29 | verbosity=0, |
| 30 | commit=False |
| 31 | ) |
| 32 | self.assertQuerysetEqual( |
| 33 | Book.objects.all(), [ |
| 34 | u'Achieving self-awareness of Python programs' |
| 35 | ], |
| 36 | lambda a: a.name |
| 37 | ) |
| 38 | |
| 39 | Book.objects.all().delete() |
| 40 | |
| 41 | management.call_command( |
| 42 | 'syncdb', |
| 43 | verbosity=0, |
| 44 | commit=False, |
| 45 | load_initial_data=False |
| 46 | ) |
| 47 | self.assertQuerysetEqual(Book.objects.all(), []) |
| 48 | |
| 49 | def test_flush(self): |
| 50 | Book.objects.all().delete() |
| 51 | |
| 52 | management.call_command( |
| 53 | 'flush', |
| 54 | verbosity=0, |
| 55 | interactive=False, |
| 56 | commit=False |
| 57 | ) |
| 58 | self.assertQuerysetEqual( |
| 59 | Book.objects.all(), [ |
| 60 | u'Achieving self-awareness of Python programs' |
| 61 | ], |
| 62 | lambda a: a.name |
| 63 | ) |
| 64 | |
| 65 | Book.objects.all().delete() |
| 66 | |
| 67 | management.call_command( |
| 68 | 'flush', |
| 69 | verbosity=0, |
| 70 | commit=False, |
| 71 | interactive=False, |
| 72 | load_initial_data=False |
| 73 | ) |
| 74 | self.assertQuerysetEqual(Book.objects.all(), []) |
| 75 | |
| 76 | |
23 | 77 | class FixtureTestCase(TestCase): |
24 | 78 | def test_initial_data(self): |
25 | 79 | "Fixtures can load initial data into models defined in packages" |