-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from Pogchamp-company/develop
Version 1.0.2
- Loading branch information
Showing
4 changed files
with
22 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 16 additions & 16 deletions
32
tests/sync_enum_values/test_rename_default_if_required.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
from alembic_postgresql_enum.sql_commands.column_default import rename_default_if_required | ||
|
||
|
||
def test_without_renames(): | ||
old_default_value = "'passive'::order_status_old" | ||
def test_without_renames_with_schema(): | ||
old_default_value = "'passive'::test.order_status_old" | ||
|
||
assert (rename_default_if_required(old_default_value, 'order_status', []) | ||
== "'passive'::order_status") | ||
assert (rename_default_if_required('test', old_default_value, 'order_status', []) | ||
== "'passive'::test.order_status") | ||
|
||
|
||
def test_with_renames(): | ||
old_default_value = "'passive'::order_status_old" | ||
def test_with_renames_with_schema(): | ||
old_default_value = "'passive'::test.order_status_old" | ||
|
||
assert (rename_default_if_required(old_default_value, 'order_status', [ | ||
assert (rename_default_if_required('test', old_default_value, 'order_status', [ | ||
('passive', 'inactive') | ||
]) == "'inactive'::order_status") | ||
]) == "'inactive'::test.order_status") | ||
|
||
|
||
def test_array_with_renames(): | ||
old_default_value = """'{"passive"}'::order_status_old""" | ||
def test_array_with_renames_with_schema(): | ||
old_default_value = """'{"passive"}'::test.order_status_old""" | ||
|
||
assert (rename_default_if_required(old_default_value, 'order_status', [ | ||
assert (rename_default_if_required('test', old_default_value, 'order_status', [ | ||
('passive', 'inactive') | ||
]) == """'{"inactive"}'::order_status""") | ||
]) == """'{"inactive"}'::test.order_status""") | ||
|
||
|
||
def test_array_default_value(): | ||
old_default_value = """'{}'::order_status_old[]""" | ||
def test_array_default_value_with_schema(): | ||
old_default_value = """'{}'::test.order_status_old[]""" | ||
|
||
assert (rename_default_if_required(old_default_value, 'order_status', []) | ||
== """'{}'::order_status[]""") | ||
assert (rename_default_if_required('test', old_default_value, 'order_status', []) | ||
== """'{}'::test.order_status[]""") |