diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-08-31 13:43:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-31 13:43:10 +0200 |
| commit | 1eb3f500a44b08a05868cd8bd85501dd6c7ee6c7 (patch) | |
| tree | daf8147744385334dc490ff6f9e74495f521108f /tests | |
| parent | b667ac24ead73300c49e265201b6c0b913ee36a3 (diff) | |
Fixed #33057 -- Fixed recreation of foreign key constraints in m2m tables when altering type of referenced primary key on Oracle.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/migrations/test_operations.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py index 6d016a2a25..5ae75a477b 100644 --- a/tests/migrations/test_operations.py +++ b/tests/migrations/test_operations.py @@ -1500,10 +1500,32 @@ class OperationTests(OperationTestBase): with connection.schema_editor() as editor: operation.database_forwards("test_alflpkfk", editor, project_state, new_state) assertIdTypeEqualsFkType() + if connection.features.supports_foreign_keys: + self.assertFKExists( + 'test_alflpkfk_pony_stables', + ['pony_id'], + ('test_alflpkfk_pony', 'id'), + ) + self.assertFKExists( + 'test_alflpkfk_stable_ponies', + ['pony_id'], + ('test_alflpkfk_pony', 'id'), + ) # And test reversal with connection.schema_editor() as editor: operation.database_backwards("test_alflpkfk", editor, new_state, project_state) assertIdTypeEqualsFkType() + if connection.features.supports_foreign_keys: + self.assertFKExists( + 'test_alflpkfk_pony_stables', + ['pony_id'], + ('test_alflpkfk_pony', 'id'), + ) + self.assertFKExists( + 'test_alflpkfk_stable_ponies', + ['pony_id'], + ('test_alflpkfk_pony', 'id'), + ) def test_alter_field_pk_mti_fk(self): app_label = 'test_alflpkmtifk' |
