Skip to content

Commit

Permalink
make foreign key migration test more thorough (#618)
Browse files Browse the repository at this point in the history
Shuffling the tables.
  • Loading branch information
dantownsend authored Sep 7, 2022
1 parent c9bb7ff commit 7754498
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/apps/migrations/auto/integration/test_migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import datetime
import decimal
import os
import random
import shutil
import tempfile
import time
Expand Down Expand Up @@ -890,9 +891,13 @@ def test_foreign_keys(self):
https://github.com/piccolo-orm/piccolo/issues/616
"""
# We'll shuffle them, to make it a more thorough test.
table_classes = random.sample(
self.table_classes, len(self.table_classes)
)

self._test_migrations(table_snapshots=[self.table_classes])
for table_class in self.table_classes:
self._test_migrations(table_snapshots=[table_classes])
for table_class in table_classes:
self.assertTrue(table_class.table_exists().run_sync())


Expand Down

0 comments on commit 7754498

Please sign in to comment.