File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -139,8 +139,8 @@ def test_multiple(self):
139139
140140
141141@postgres_only
142- class TestNull (DBTestCase ):
143- def test_null (self ):
142+ class TestSetNull (DBTestCase ):
143+ def test_set_null (self ):
144144 query = """
145145 SELECT is_nullable FROM information_schema.columns
146146 WHERE table_name = 'band'
@@ -157,6 +157,22 @@ def test_null(self):
157157 self .assertTrue (response [0 ]["is_nullable" ] == "NO" )
158158
159159
160+ @postgres_only
161+ class TestSetLength (DBTestCase ):
162+ def test_set_length (self ):
163+ query = """
164+ SELECT character_maximum_length FROM information_schema.columns
165+ WHERE table_name = 'band'
166+ AND table_catalog = 'piccolo'
167+ AND column_name = 'name'
168+ """
169+
170+ for length in (5 , 20 , 50 ):
171+ Band .alter ().set_length (Band .name , length = length ).run_sync ()
172+ response = Band .raw (query ).run_sync ()
173+ self .assertTrue (response [0 ]["character_maximum_length" ] == length )
174+
175+
160176@postgres_only
161177class TestSetDefault (DBTestCase ):
162178 def test_set_default (self ):
You can’t perform that action at this time.
0 commit comments