Add ZulipAuthMixin tests.

This commit is contained in:
Umair Khan
2016-10-26 15:39:09 +05:00
committed by Tim Abbott
parent 6dbe425675
commit d9e1975d2c

View File

@@ -24,7 +24,7 @@ from zerver.models import \
from zproject.backends import ZulipDummyBackend, EmailAuthBackend, \
GoogleMobileOauth2Backend, ZulipRemoteUserBackend, ZulipLDAPAuthBackend, \
ZulipLDAPUserPopulator, DevAuthBackend, GitHubAuthBackend
ZulipLDAPUserPopulator, DevAuthBackend, GitHubAuthBackend, ZulipAuthMixin
from social.exceptions import AuthFailed
from social.strategies.django_strategy import DjangoStrategy
@@ -1180,3 +1180,10 @@ class TestZulipLDAPUserPopulator(ZulipTestCase):
backend = ZulipLDAPUserPopulator()
result = backend.authenticate('hamlet@zulip.com', 'testing') # type: ignore # complains that the function does not return any value!
self.assertIs(result, None)
class TestZulipAuthMixin(ZulipTestCase):
def test_get_user(self):
# type: () -> None
backend = ZulipAuthMixin()
result = backend.get_user(11111)
self.assertIs(result, None)