From 89f40e36246100df6a11316c31a76712ebc6c501 Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Tue, 26 Feb 2013 09:53:47 +0100 Subject: Merged regressiontests and modeltests into the test root. --- .../initial_sql_regress/__init__.py | 0 .../regressiontests/initial_sql_regress/models.py | 10 -------- .../initial_sql_regress/sql/simple.sql | 11 --------- tests/regressiontests/initial_sql_regress/tests.py | 28 ---------------------- 4 files changed, 49 deletions(-) delete mode 100644 tests/regressiontests/initial_sql_regress/__init__.py delete mode 100644 tests/regressiontests/initial_sql_regress/models.py delete mode 100644 tests/regressiontests/initial_sql_regress/sql/simple.sql delete mode 100644 tests/regressiontests/initial_sql_regress/tests.py (limited to 'tests/regressiontests/initial_sql_regress') diff --git a/tests/regressiontests/initial_sql_regress/__init__.py b/tests/regressiontests/initial_sql_regress/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/regressiontests/initial_sql_regress/models.py b/tests/regressiontests/initial_sql_regress/models.py deleted file mode 100644 index 76de6d3bcb..0000000000 --- a/tests/regressiontests/initial_sql_regress/models.py +++ /dev/null @@ -1,10 +0,0 @@ -""" -Regression tests for initial SQL insertion. -""" - -from django.db import models - - -class Simple(models.Model): - name = models.CharField(max_length = 50) - diff --git a/tests/regressiontests/initial_sql_regress/sql/simple.sql b/tests/regressiontests/initial_sql_regress/sql/simple.sql deleted file mode 100644 index d82f8381af..0000000000 --- a/tests/regressiontests/initial_sql_regress/sql/simple.sql +++ /dev/null @@ -1,11 +0,0 @@ --- a comment -INSERT INTO initial_sql_regress_simple (name) VALUES ('John'); -- another comment -INSERT INTO initial_sql_regress_simple (name) VALUES ('-- Comment Man'); -INSERT INTO initial_sql_regress_simple (name) VALUES ('Paul'); -INSERT INTO - initial_sql_regress_simple (name) VALUES ('Ringo'); -INSERT INTO initial_sql_regress_simple (name) VALUES ('George'); -INSERT INTO initial_sql_regress_simple (name) VALUES ('Miles O''Brien'); -INSERT INTO initial_sql_regress_simple (name) VALUES ('Semicolon;Man'); -INSERT INTO initial_sql_regress_simple (name) VALUES ('This line has a Windows line ending'); - diff --git a/tests/regressiontests/initial_sql_regress/tests.py b/tests/regressiontests/initial_sql_regress/tests.py deleted file mode 100644 index 39d8921061..0000000000 --- a/tests/regressiontests/initial_sql_regress/tests.py +++ /dev/null @@ -1,28 +0,0 @@ -from django.core.management.color import no_style -from django.core.management.sql import custom_sql_for_model -from django.db import connections, DEFAULT_DB_ALIAS -from django.test import TestCase - -from .models import Simple - - -class InitialSQLTests(TestCase): - # The format of the included SQL file for this test suite is important. - # It must end with a trailing newline in order to test the fix for #2161. - - def test_initial_sql(self): - # As pointed out by #14661, test data loaded by custom SQL - # can't be relied upon; as a result, the test framework flushes the - # data contents before every test. This test validates that this has - # occurred. - self.assertEqual(Simple.objects.count(), 0) - - def test_custom_sql(self): - # Simulate the custom SQL loading by syncdb - connection = connections[DEFAULT_DB_ALIAS] - custom_sql = custom_sql_for_model(Simple, no_style(), connection) - self.assertEqual(len(custom_sql), 8) - cursor = connection.cursor() - for sql in custom_sql: - cursor.execute(sql) - self.assertEqual(Simple.objects.count(), 8) -- cgit v1.3