File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 88from postgres .cursors import TooFew , TooMany , SimpleDictCursor
99from postgres .orm import ReadOnly , Model
1010from psycopg2 import InterfaceError , ProgrammingError
11- from pytest import raises
11+ from pytest import mark , raises
1212
1313
1414DATABASE_URL = os .environ ['DATABASE_URL' ]
@@ -339,6 +339,14 @@ def test_add_column_doesnt_break_anything(self):
339339 one = self .db .one ("SELECT foo.*::foo FROM foo WHERE bar='baz'" )
340340 assert one .boo is None
341341
342+ @mark .xfail
343+ def test_add_and_drop_columns (self ):
344+ self .db .run ("ALTER TABLE foo ADD COLUMN biz int NOT NULL DEFAULT 0" )
345+ self .db .run ("ALTER TABLE foo DROP COLUMN bar" )
346+ one = self .db .one ("SELECT foo.*::foo FROM foo LIMIT 1" )
347+ assert one .biz == 0
348+ assert not hasattr (one , 'bar' )
349+
342350
343351# cursor_factory
344352# ==============
You can’t perform that action at this time.
0 commit comments