diff options
Diffstat (limited to 'parts/django/tests/regressiontests/initial_sql_regress')
4 files changed, 27 insertions, 0 deletions
diff --git a/parts/django/tests/regressiontests/initial_sql_regress/__init__.py b/parts/django/tests/regressiontests/initial_sql_regress/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/parts/django/tests/regressiontests/initial_sql_regress/__init__.py diff --git a/parts/django/tests/regressiontests/initial_sql_regress/models.py b/parts/django/tests/regressiontests/initial_sql_regress/models.py new file mode 100644 index 0000000..9f91802 --- /dev/null +++ b/parts/django/tests/regressiontests/initial_sql_regress/models.py @@ -0,0 +1,11 @@ +""" +Regression tests for initial SQL insertion. +""" + +from django.db import models + +class Simple(models.Model): + name = models.CharField(max_length = 50) + +# NOTE: 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. diff --git a/parts/django/tests/regressiontests/initial_sql_regress/sql/simple.sql b/parts/django/tests/regressiontests/initial_sql_regress/sql/simple.sql new file mode 100644 index 0000000..ca9bd40 --- /dev/null +++ b/parts/django/tests/regressiontests/initial_sql_regress/sql/simple.sql @@ -0,0 +1,8 @@ +INSERT INTO initial_sql_regress_simple (name) VALUES ('John'); +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/parts/django/tests/regressiontests/initial_sql_regress/tests.py b/parts/django/tests/regressiontests/initial_sql_regress/tests.py new file mode 100644 index 0000000..2b3ca91 --- /dev/null +++ b/parts/django/tests/regressiontests/initial_sql_regress/tests.py @@ -0,0 +1,8 @@ +from django.test import TestCase + +from models import Simple + + +class InitialSQLTests(TestCase): + def test_initial_sql(self): + self.assertEqual(Simple.objects.count(), 7) |