Add encrypted envelope recipient state
This commit is contained in:
@@ -22,6 +22,10 @@ class PostboxMigrationTests(unittest.TestCase):
|
||||
"govoplan_postbox.backend.migrations.versions."
|
||||
"f5c8d0e3b7a2_v012_authoring_and_occ"
|
||||
)
|
||||
envelope_migration = importlib.import_module(
|
||||
"govoplan_postbox.backend.migrations.versions."
|
||||
"a6d9e1f4c8b3_v013_external_recipient_tokens"
|
||||
)
|
||||
engine = create_engine("sqlite:///:memory:")
|
||||
try:
|
||||
with engine.begin() as connection:
|
||||
@@ -29,13 +33,16 @@ class PostboxMigrationTests(unittest.TestCase):
|
||||
original = migration.op
|
||||
route_original = route_migration.op
|
||||
occ_original = occ_migration.op
|
||||
envelope_original = envelope_migration.op
|
||||
migration.op = operations
|
||||
route_migration.op = operations
|
||||
occ_migration.op = operations
|
||||
envelope_migration.op = operations
|
||||
try:
|
||||
migration.upgrade()
|
||||
route_migration.upgrade()
|
||||
occ_migration.upgrade()
|
||||
envelope_migration.upgrade()
|
||||
tables = set(inspect(connection).get_table_names())
|
||||
self.assertIn("postboxes", tables)
|
||||
self.assertIn("postbox_messages", tables)
|
||||
@@ -52,6 +59,7 @@ class PostboxMigrationTests(unittest.TestCase):
|
||||
"ciphertext_ref",
|
||||
"signed_manifest_ref",
|
||||
"wrapped_keys",
|
||||
"external_recipient_tokens",
|
||||
"key_epoch",
|
||||
"expires_at",
|
||||
"withdrawn_at",
|
||||
@@ -83,6 +91,7 @@ class PostboxMigrationTests(unittest.TestCase):
|
||||
route_columns
|
||||
)
|
||||
)
|
||||
envelope_migration.downgrade()
|
||||
occ_migration.downgrade()
|
||||
route_migration.downgrade()
|
||||
migration.downgrade()
|
||||
@@ -97,6 +106,7 @@ class PostboxMigrationTests(unittest.TestCase):
|
||||
migration.op = original
|
||||
route_migration.op = route_original
|
||||
occ_migration.op = occ_original
|
||||
envelope_migration.op = envelope_original
|
||||
finally:
|
||||
engine.dispose()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user