Skip to content

Commit d99d3fb

Browse files
committed
Increasing test coverage.
1 parent d56ad55 commit d99d3fb

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

oauth2_provider/tests/test_models.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from django.test.utils import override_settings
1111
from django.core.exceptions import ValidationError
1212

13-
from ..models import AccessToken, get_application_model
13+
from ..models import AccessToken, get_application_model, Grant, AccessToken, RefreshToken
1414
from ..compat import get_user_model
1515

1616

@@ -98,3 +98,24 @@ def test_related_objects(self):
9898
related_object_names = [ro.name for ro in UserModel._meta.get_all_related_objects()]
9999
self.assertNotIn('oauth2_provider:application', related_object_names)
100100
self.assertIn('tests:testapplication', related_object_names)
101+
102+
103+
class TestGrantModel(TestCase):
104+
105+
def test_str(self):
106+
grant = Grant(code="test_code")
107+
self.assertEqual("%s" % grant, grant.code)
108+
109+
110+
class TestAccessTokenModel(TestCase):
111+
112+
def test_str(self):
113+
access_token = AccessToken(token="test_token")
114+
self.assertEqual("%s" % access_token, access_token.token)
115+
116+
117+
class TestRefreshTokenModel(TestCase):
118+
119+
def test_str(self):
120+
refresh_token = RefreshToken(token="test_token")
121+
self.assertEqual("%s" % refresh_token, refresh_token.token)

0 commit comments

Comments
 (0)