File tree Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 22from oauth2_provider .models import AbstractApplication
33
44
5- class TestApplication (AbstractApplication ):
5+ class SampleApplication (AbstractApplication ):
66 custom_field = models .CharField (max_length = 255 )
Original file line number Diff line number Diff line change 88from oauth2_provider .views .application import ApplicationRegistration
99from oauth2_provider .settings import oauth2_settings
1010
11- from .models import TestApplication
11+ from .models import SampleApplication
1212
1313
1414Application = get_application_model ()
@@ -33,11 +33,11 @@ def test_get_form_class(self):
3333 'OAUTH2_PROVIDER_APPLICATION_MODEL' setting.
3434 """
3535 # Patch oauth2 settings to use a custom Application model
36- oauth2_settings .APPLICATION_MODEL = ' tests.TestApplication'
36+ oauth2_settings .APPLICATION_MODEL = " tests.SampleApplication"
3737 # Create a registration view and tests that the model form is bound
3838 # to the custom Application model
3939 application_form_class = ApplicationRegistration ().get_form_class ()
40- self .assertEqual (TestApplication , application_form_class ._meta .model )
40+ self .assertEqual (SampleApplication , application_form_class ._meta .model )
4141 # Revert oauth2 settings
4242 oauth2_settings .APPLICATION_MODEL = 'oauth2_provider.Application'
4343
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ def test_scopes_property(self):
107107 self .assertEqual (access_token2 .scopes , {'write' : 'Writing scope' })
108108
109109
110- @override_settings (OAUTH2_PROVIDER_APPLICATION_MODEL = ' tests.TestApplication' )
110+ @override_settings (OAUTH2_PROVIDER_APPLICATION_MODEL = " tests.SampleApplication" )
111111class TestCustomApplicationModel (TestCase ):
112112 def setUp (self ):
113113 self .
user = UserModel .
objects .
create_user (
"test_user" ,
"[email protected] " ,
"123456" )
@@ -131,8 +131,7 @@ def test_related_objects(self):
131131 and f .auto_created and not f .concrete
132132 ]
133133 self .assertNotIn ('oauth2_provider:application' , related_object_names )
134- self .assertIn ('tests%stestapplication' % (':' if django .VERSION < (1 , 8 ) else '_' ),
135- related_object_names )
134+ self .assertIn ("tests_sampleapplication" , related_object_names )
136135
137136
138137class TestGrantModel (TestCase ):
You can’t perform that action at this time.
0 commit comments