From badf4d6d68a0403fa73c2abc52e743c98069ad89 Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Wed, 17 Aug 2022 09:59:16 +0200 Subject: [PATCH 1/2] tests: remove broken migration test (#68204) --- tests/test_all.py | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/tests/test_all.py b/tests/test_all.py index 567348d..4d5d723 100644 --- a/tests/test_all.py +++ b/tests/test_all.py @@ -320,35 +320,6 @@ def test_fedict_authenticator_data_migration(settings): assert authenticator.enabled is True -def test_cleanup_saml_authenticator_data_migration(): - app = 'authentic2_auth_fedict' - migrate_from = [(app, '0002_auto_20220706_1712'), ('authentic2_auth_saml', '0002_auto_20220608_1559')] - migrate_to = [(app, '0003_auto_20220721_1724'), ('authentic2_auth_saml', '0002_auto_20220608_1559')] - - executor = MigrationExecutor(connection) - old_apps = executor.loader.project_state(migrate_from).apps - executor.migrate(migrate_from) - SAMLAuthenticator = old_apps.get_model('authentic2_auth_saml', 'SAMLAuthenticator') - - SAMLAuthenticator.objects.all().delete() - SAMLAuthenticator.objects.create(slug='0', enabled=False) - SAMLAuthenticator.objects.create( - slug='1', enabled=True, metadata_url='https://iamapps-public.belgium.be/saml/fas-metadata.xml' - ) - SAMLAuthenticator.objects.create( - slug='2', enabled=False, metadata_url='https://iamapps-public.belgium.be/saml/fas-metadata.xml' - ) # only this one should get deleted - - executor = MigrationExecutor(connection) - executor.migrate(migrate_to) - executor.loader.build_graph() - new_apps = executor.loader.project_state(migrate_to).apps - SAMLAuthenticator = new_apps.get_model('authentic2_auth_saml', 'SAMLAuthenticator') - - assert SAMLAuthenticator.objects.count() == 2 - assert not SAMLAuthenticator.objects.filter(slug='2').exists() - - def test_manager(app, admin): resp = login(app, admin, path='/manage/authenticators/', index=0) -- 2.30.2