From 43349c5c80a8e74cf2577e5d7f2a900588253b00 Mon Sep 17 00:00:00 2001 From: Raniere Silva Date: Mon, 16 Oct 2017 16:14:07 +0100 Subject: [PATCH] Add test to SQLite restore_dump with new line --- dbbackup/tests/test_connectors.py | 6 ++++++ dbbackup/tests/testapp/models.py | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/dbbackup/tests/test_connectors.py b/dbbackup/tests/test_connectors.py index 8498e5f5..861eed08 100644 --- a/dbbackup/tests/test_connectors.py +++ b/dbbackup/tests/test_connectors.py @@ -119,6 +119,12 @@ def test_create_dump_with_unicode(self): dump = connector.create_dump() self.assertTrue(dump.read()) + def test_create_dump_with_newline(self): + TextModel.objects.create(field='foo\nbar') + connector = SqliteConnector() + dump = connector.create_dump() + self.assertTrue(dump.read()) + def test_restore_dump(self): connector = SqliteConnector() dump = connector.create_dump() diff --git a/dbbackup/tests/testapp/models.py b/dbbackup/tests/testapp/models.py index 970d3abb..ed20e3b3 100644 --- a/dbbackup/tests/testapp/models.py +++ b/dbbackup/tests/testapp/models.py @@ -10,7 +10,11 @@ class CharModel(models.Model): field = models.CharField(max_length=10) + +class TextModel(models.Model): + field = models.TextField() + class ForeignKeyModel(models.Model): field = models.ForeignKey(CharModel)