Skip to content

Commit

Permalink
Add test to SQLite restore_dump with new line
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaiacs committed Oct 16, 2017
1 parent 458f029 commit 43349c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dbbackup/tests/test_connectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions dbbackup/tests/testapp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 43349c5

Please sign in to comment.