Skip to content

Commit 16524e0

Browse files
committed
completed mixins coverage
1 parent 2e1c58e commit 16524e0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

oauth2_provider/tests/test_mixins.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,22 @@ class TestView(OAuthLibMixin, View):
4242

4343
self.assertIsInstance(test_view.get_server(), Server)
4444

45+
def test_custom_backend(self):
46+
class AnotherOauthLibBackend(object):
47+
pass
48+
49+
class TestView(OAuthLibMixin, View):
50+
server_class = Server
51+
validator_class = OAuth2Validator
52+
oauthlib_core_class = AnotherOauthLibBackend
53+
54+
request = self.request_factory.get("/fake-req")
55+
request.user = "fake"
56+
test_view = TestView()
57+
58+
self.assertEqual(test_view.get_oauthlib_core_class(),
59+
AnotherOauthLibBackend)
60+
4561

4662
class TestScopedResourceMixin(TestCase):
4763
@classmethod

0 commit comments

Comments
 (0)