mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
tests: Add wrapper for client.logout in ZulipTestCase.
In this commit we add a logout wrapper so as to enable developers to just do self.logout instead of doing a post request at API endpoint for logout. This is achieved by adding a wrapper function for the Django's client.logout contained in TestCase. We add this by extending ZulipTestCase to have a logout function.
This commit is contained in:
committed by
Tim Abbott
parent
cf001876d4
commit
bdcddd35d0
@@ -223,6 +223,10 @@ class ZulipTestCase(TestCase):
|
||||
else:
|
||||
self.assertFalse(self.client.login(username=email, password=password))
|
||||
|
||||
def logout(self):
|
||||
# type: () -> None
|
||||
self.client.logout()
|
||||
|
||||
def register(self, email, password):
|
||||
# type: (Text, Text) -> HttpResponse
|
||||
self.client_post('/accounts/home/', {'email': email})
|
||||
|
||||
Reference in New Issue
Block a user