Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Removes unnecessary declarations in the tests for the admin API. (#9063)
Browse files Browse the repository at this point in the history
  • Loading branch information
dklimpel authored Jan 11, 2021
1 parent 1315a2e commit 42d3a28
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 17 deletions.
1 change: 1 addition & 0 deletions changelog.d/9063.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removes unnecessary declarations in the tests for the admin API.
3 changes: 0 additions & 3 deletions tests/rest/admin/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ class DeleteGroupTestCase(unittest.HomeserverTestCase):
]

def prepare(self, reactor, clock, hs):
self.store = hs.get_datastore()

self.admin_user = self.register_user("admin", "pass", admin=True)
self.admin_user_tok = self.login("admin", "pass")

Expand Down Expand Up @@ -156,7 +154,6 @@ class QuarantineMediaTestCase(unittest.HomeserverTestCase):

def prepare(self, reactor, clock, hs):
self.store = hs.get_datastore()
self.hs = hs

# Allow for uploading and downloading to/from the media repo
self.media_repo = hs.get_media_repository_resource()
Expand Down
4 changes: 0 additions & 4 deletions tests/rest/admin/test_event_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ class EventReportsTestCase(unittest.HomeserverTestCase):
]

def prepare(self, reactor, clock, hs):
self.store = hs.get_datastore()

self.admin_user = self.register_user("admin", "pass", admin=True)
self.admin_user_tok = self.login("admin", "pass")

Expand Down Expand Up @@ -371,8 +369,6 @@ class EventReportDetailTestCase(unittest.HomeserverTestCase):
]

def prepare(self, reactor, clock, hs):
self.store = hs.get_datastore()

self.admin_user = self.register_user("admin", "pass", admin=True)
self.admin_user_tok = self.login("admin", "pass")

Expand Down
2 changes: 0 additions & 2 deletions tests/rest/admin/test_media.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class DeleteMediaByIDTestCase(unittest.HomeserverTestCase):
]

def prepare(self, reactor, clock, hs):
self.handler = hs.get_device_handler()
self.media_repo = hs.get_media_repository_resource()
self.server_name = hs.hostname

Expand Down Expand Up @@ -181,7 +180,6 @@ class DeleteMediaByDateSizeTestCase(unittest.HomeserverTestCase):
]

def prepare(self, reactor, clock, hs):
self.handler = hs.get_device_handler()
self.media_repo = hs.get_media_repository_resource()
self.server_name = hs.hostname

Expand Down
2 changes: 0 additions & 2 deletions tests/rest/admin/test_room.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,6 @@ class RoomTestCase(unittest.HomeserverTestCase):
]

def prepare(self, reactor, clock, hs):
self.store = hs.get_datastore()

# Create user
self.admin_user = self.register_user("admin", "pass", admin=True)
self.admin_user_tok = self.login("admin", "pass")
Expand Down
1 change: 0 additions & 1 deletion tests/rest/admin/test_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class UserMediaStatisticsTestCase(unittest.HomeserverTestCase):
]

def prepare(self, reactor, clock, hs):
self.store = hs.get_datastore()
self.media_repo = hs.get_media_repository_resource()

self.admin_user = self.register_user("admin", "pass", admin=True)
Expand Down
5 changes: 0 additions & 5 deletions tests/rest/admin/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -1204,8 +1204,6 @@ class UserMembershipRestTestCase(unittest.HomeserverTestCase):
]

def prepare(self, reactor, clock, hs):
self.store = hs.get_datastore()

self.admin_user = self.register_user("admin", "pass", admin=True)
self.admin_user_tok = self.login("admin", "pass")

Expand Down Expand Up @@ -1401,7 +1399,6 @@ class UserMediaRestTestCase(unittest.HomeserverTestCase):
]

def prepare(self, reactor, clock, hs):
self.store = hs.get_datastore()
self.media_repo = hs.get_media_repository_resource()

self.admin_user = self.register_user("admin", "pass", admin=True)
Expand Down Expand Up @@ -1868,8 +1865,6 @@ class WhoisRestTestCase(unittest.HomeserverTestCase):
]

def prepare(self, reactor, clock, hs):
self.store = hs.get_datastore()

self.admin_user = self.register_user("admin", "pass", admin=True)
self.admin_user_tok = self.login("admin", "pass")

Expand Down

0 comments on commit 42d3a28

Please sign in to comment.