tests: remove broken migration test (#68204)

This commit is contained in:
Valentin Deniaud 2022-08-17 09:59:16 +02:00
parent ba22ea30e9
commit badf4d6d68
1 changed files with 0 additions and 29 deletions

View File

@ -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)