summary refs log tree commit diff
path: root/tests/rest/admin/test_admin.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-04-22 16:34:35 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-04-22 16:34:35 +0100
commita31eb4a9fd1c6af6de0c5162d80736eae7bdaba6 (patch)
tree1fd39929c29ecd3836bda570dbf33cc4fe2a8b7d /tests/rest/admin/test_admin.py
parentMerge commit 'd34c6e127' into anoa/dinsic_release_1_31_0 (diff)
parentAdd an admin API endpoint to protect media. (#9086) (diff)
downloadsynapse-a31eb4a9fd1c6af6de0c5162d80736eae7bdaba6.tar.xz
Merge commit '3e4cdfe5d' into anoa/dinsic_release_1_31_0
Diffstat (limited to 'tests/rest/admin/test_admin.py')
-rw-r--r--tests/rest/admin/test_admin.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/rest/admin/test_admin.py b/tests/rest/admin/test_admin.py

index 586b877bda..9d22c04073 100644 --- a/tests/rest/admin/test_admin.py +++ b/tests/rest/admin/test_admin.py
@@ -153,8 +153,6 @@ class QuarantineMediaTestCase(unittest.HomeserverTestCase): ] def prepare(self, reactor, clock, hs): - self.store = hs.get_datastore() - # Allow for uploading and downloading to/from the media repo self.media_repo = hs.get_media_repository_resource() self.download_resource = self.media_repo.children[b"download"] @@ -428,7 +426,11 @@ class QuarantineMediaTestCase(unittest.HomeserverTestCase): # Mark the second item as safe from quarantine. _, media_id_2 = server_and_media_id_2.split("/") - self.get_success(self.store.mark_local_media_as_safe(media_id_2)) + # Quarantine the media + url = "/_synapse/admin/v1/media/protect/%s" % (urllib.parse.quote(media_id_2),) + channel = self.make_request("POST", url, access_token=admin_user_tok) + self.pump(1.0) + self.assertEqual(200, int(channel.code), msg=channel.result["body"]) # Quarantine all media by this user url = "/_synapse/admin/v1/user/%s/media/quarantine" % urllib.parse.quote(