summaryrefslogtreecommitdiff
path: root/tests/test_regressions.py
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2013-04-20 08:32:08 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2013-04-20 08:32:08 +0200
commitfd480bf40646cdb53bce377db5d11dc52a760dad (patch)
tree59bea5608c5b8c580e9dc426e9a2d79161f99af9 /tests/test_regressions.py
parent90ebf68e551805a30cf7c9907f04f7038e941b5a (diff)
downloadsqlparse-fd480bf40646cdb53bce377db5d11dc52a760dad.tar.gz
Allow NULL keyword in assignments (fixes #90).
Diffstat (limited to 'tests/test_regressions.py')
-rw-r--r--tests/test_regressions.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_regressions.py b/tests/test_regressions.py
index e9d890b..423f2d6 100644
--- a/tests/test_regressions.py
+++ b/tests/test_regressions.py
@@ -198,3 +198,23 @@ def test_format_accepts_encoding(): # issue20
else:
tformatted = 'insert into foo\nvalues (1); -- Песня про надежду\n'
assert formatted == tformatted
+
+
+def test_issue90():
+ sql = ('UPDATE "gallery_photo" SET "owner_id" = 4018, "deleted_at" = NULL,'
+ ' "width" = NULL, "height" = NULL, "rating_votes" = 0,'
+ ' "rating_score" = 0, "thumbnail_width" = NULL,'
+ ' "thumbnail_height" = NULL, "price" = 1, "description" = NULL')
+ formatted = sqlparse.format(sql, reindent=True)
+ tformatted = '\n'.join(['UPDATE "gallery_photo"',
+ 'SET "owner_id" = 4018,',
+ ' "deleted_at" = NULL,',
+ ' "width" = NULL,',
+ ' "height" = NULL,',
+ ' "rating_votes" = 0,',
+ ' "rating_score" = 0,',
+ ' "thumbnail_width" = NULL,',
+ ' "thumbnail_height" = NULL,',
+ ' "price" = 1,',
+ ' "description" = NULL'])
+ assert formatted == tformatted