Skip to content

Commit

Permalink
fix(tests): restore the latest migration after migration tests (#26928)
Browse files Browse the repository at this point in the history
  • Loading branch information
skoob13 authored Dec 16, 2024
1 parent d149515 commit 16730d3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions posthog/test/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,14 @@ def _execute_migration_with_snapshots(self, executor):
def setUpBeforeMigration(self, apps):
pass

@classmethod
def tearDownClass(cls):
super().tearDownClass() # type: ignore
executor = MigrationExecutor(connection) # Reset Django's migration state
targets = executor.loader.graph.leaf_nodes()
executor.migrate(targets) # Migrate to the latest migration
executor.loader.build_graph() # Reload.


class TestMigrations(BaseTestMigrations, BaseTest):
"""
Expand Down

0 comments on commit 16730d3

Please sign in to comment.