Skip to content

Commit e7217af

Browse files
committed
added tests for Boolean columns in migrations
1 parent cf243d2 commit e7217af

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/apps/migrations/auto/integration/test_migrations.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from piccolo.conf.apps import AppConfig
1313
from piccolo.columns.column_types import (
1414
BigInt,
15+
Boolean,
1516
Date,
1617
Integer,
1718
Interval,
@@ -64,6 +65,10 @@ def timedelta_default():
6465
return datetime.timedelta(days=1)
6566

6667

68+
def boolean_default():
69+
return True
70+
71+
6772
@postgres_only
6873
class TestMigrations(TestCase):
6974
def tearDown(self):
@@ -288,3 +293,19 @@ def test_interval_column(self):
288293
]
289294
]
290295
)
296+
297+
def test_boolean_column(self):
298+
self._test_migrations(
299+
table_classes=[
300+
self.table(column)
301+
for column in [
302+
Boolean(),
303+
Boolean(default=True),
304+
Boolean(default=boolean_default),
305+
Boolean(null=True, default=None),
306+
Boolean(null=False),
307+
Boolean(index=True),
308+
Boolean(index=False),
309+
]
310+
]
311+
)

0 commit comments

Comments
 (0)