From 0153163669053cbe8234500389a030d719367e72 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 13 Nov 2020 21:41:15 +0100 Subject: [PATCH] misc: remove check on sync-metadata --source option (#48500) --- src/authentic2/saml/management/commands/sync-metadata.py | 6 ------ tests/test_commands.py | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/authentic2/saml/management/commands/sync-metadata.py b/src/authentic2/saml/management/commands/sync-metadata.py index 25a49245f..7cdb70c40 100644 --- a/src/authentic2/saml/management/commands/sync-metadata.py +++ b/src/authentic2/saml/management/commands/sync-metadata.py @@ -317,12 +317,6 @@ Any other kind of attribute filter policy is unsupported. verbosity = int(options['verbosity']) source = options['source'] metadata_file_path = options['metadata_file_path'] - # Check sources - try: - if source is not None: - source.decode('ascii') - except UnicodeDecodeError: - raise CommandError('--source MUST be an ASCII string value') if metadata_file_path.startswith('http://') or metadata_file_path.startswith('https://'): response = requests.get(metadata_file_path) if not response.ok: diff --git a/tests/test_commands.py b/tests/test_commands.py index ac80ad6c4..d7f0d8cd0 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -287,7 +287,7 @@ def test_resetpassword(simple_user): def test_sync_metadata(db): test_file = py.path.local(__file__).dirpath('metadata.xml').strpath - call_command('sync-metadata', test_file) + call_command('sync-metadata', test_file, source='abcd') def test_check_and_repair_managers_of_roles(db, capsys):