Skip to content

Commit 8c44f07

Browse files
committed
Fix broken test
1 parent dbbe267 commit 8c44f07

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

tests/test_alter.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,23 @@ def test_alter():
4242

4343

4444
@schema
45-
class TypeMaster(dj.Manual):
45+
class AlterMaster(dj.Manual):
4646
definition = """
4747
master_id : int
4848
"""
4949

50-
class Type(dj.Part):
51-
# NOTE type_id is necessary because table.alter cannot alter the primary key (yet)
50+
class AlterPart(dj.Part):
5251
definition = """
5352
-> master
54-
type_id : int
5553
"""
5654

5755
definition1 = """
58-
-> TypeMaster
59-
type_id : int
56+
-> AlterMaster
6057
"""
6158

6259
def test_alter_part():
63-
original = schema.connection.query("SHOW CREATE TABLE " + TypeMaster.Type.full_table_name).fetchone()[1]
64-
TypeMaster.Type.definition = Experiment.definition1
65-
TypeMaster.Type.alter(prompt=False)
66-
altered = schema.connection.query("SHOW CREATE TABLE " + TypeMaster.Type.full_table_name).fetchone()[1]
60+
original = schema.connection.query("SHOW CREATE TABLE " + AlterMaster.AlterPart.full_table_name).fetchone()[1]
61+
AlterMaster.AlterPart.definition = AlterMaster.AlterPart.definition1
62+
AlterMaster.AlterPart.alter(prompt=False)
63+
altered = schema.connection.query("SHOW CREATE TABLE " + AlterMaster.AlterPart.full_table_name).fetchone()[1]
6764
assert_equal(original, altered)

0 commit comments

Comments
 (0)