diff options
| author | David Wobrock <david.wobrock@gmail.com> | 2022-07-02 19:55:37 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-07-08 07:05:55 +0200 |
| commit | 41019e48bbf082c985e6ba3bad34d118b903bff1 (patch) | |
| tree | 63e08889847484c233e690c81375f7a4e73eec18 /tests/db_functions | |
| parent | 57793b47657ace966ce8ce96d801ac0d85e5efc6 (diff) | |
Refs #27236 -- Added generic mechanism to handle the deprecation of migration operations.
Diffstat (limited to 'tests/db_functions')
| -rw-r--r-- | tests/db_functions/migrations/0001_setup_extensions.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/db_functions/migrations/0001_setup_extensions.py b/tests/db_functions/migrations/0001_setup_extensions.py index 0289055499..5909a96eb8 100644 --- a/tests/db_functions/migrations/0001_setup_extensions.py +++ b/tests/db_functions/migrations/0001_setup_extensions.py @@ -1,11 +1,22 @@ -from unittest import mock - from django.db import migrations +from django.db.migrations.operations.base import Operation + + +class DummyOperation(Operation): + def state_forwards(self, app_label, state): + pass + + def database_forwards(self, app_label, schema_editor, from_state, to_state): + pass + + def database_backwards(self, app_label, schema_editor, from_state, to_state): + pass + try: from django.contrib.postgres.operations import CryptoExtension except ImportError: - CryptoExtension = mock.Mock() + CryptoExtension = DummyOperation class Migration(migrations.Migration): |
