def tearDown(self):
     self.strategy = None
     User.reset_cache()
     TestUserSocialAuth.reset_cache()
     TestNonce.reset_cache()
     TestAssociation.reset_cache()
     HTTPretty.disable()
 def tearDown(self):
     self.strategy = None
     User.reset_cache()
     TestUserSocialAuth.reset_cache()
     TestNonce.reset_cache()
     TestAssociation.reset_cache()
     HTTPretty.disable()
Example #3
0
 def setUp(self):
     HTTPretty.enable()
     User.reset_cache()
     TestUserSocialAuth.reset_cache()
     TestNonce.reset_cache()
     TestAssociation.reset_cache()
     self.backend = module_member('social.backends.github.GithubOAuth2')
     self.strategy = TestStrategy(self.backend, TestStorage)
     self.user = None
Example #4
0
 def setUp(self):
     HTTPretty.enable()
     User.reset_cache()
     TestUserSocialAuth.reset_cache()
     TestNonce.reset_cache()
     TestAssociation.reset_cache()
     self.backend = module_member('social.backends.github.GithubOAuth2')
     self.strategy = TestStrategy(self.backend, TestStorage)
     self.user = None
Example #5
0
 def tearDown(self):
     self.backend = None
     self.strategy = None
     self.user = None
     User.reset_cache()
     User.set_active(True)
     TestUserSocialAuth.reset_cache()
     TestNonce.reset_cache()
     TestAssociation.reset_cache()
     HTTPretty.disable()
Example #6
0
 def setUp(self):
     HTTPretty.enable()
     User.reset_cache()
     TestUserSocialAuth.reset_cache()
     TestNonce.reset_cache()
     TestAssociation.reset_cache()
     Backend = module_member("social.backends.github.GithubOAuth2")
     self.strategy = self.strategy or TestStrategy(TestStorage)
     self.backend = Backend(self.strategy, redirect_uri="/complete/github")
     self.user = None
Example #7
0
 def tearDown(self):
     self.backend = None
     self.strategy = None
     self.user = None
     User.reset_cache()
     User.set_active(True)
     TestUserSocialAuth.reset_cache()
     TestNonce.reset_cache()
     TestAssociation.reset_cache()
     HTTPretty.disable()
Example #8
0
 def setUp(self):
     HTTPretty.enable()
     User.reset_cache()
     TestUserSocialAuth.reset_cache()
     TestNonce.reset_cache()
     TestAssociation.reset_cache()
     Backend = module_member('social.backends.github.GithubOAuth2')
     self.strategy = self.strategy or TestStrategy(TestStorage)
     self.backend = Backend(self.strategy, redirect_uri='/complete/github')
     self.user = None
Example #9
0
 def tearDown(self):
     HTTPretty.disable()
     self.backend = None
     self.strategy = None
     self.name = None
     self.complete_url = None
     User.reset_cache()
     TestUserSocialAuth.reset_cache()
     TestNonce.reset_cache()
     TestAssociation.reset_cache()
     TestCode.reset_cache()
Example #10
0
 def tearDown(self):
     HTTPretty.disable()
     self.backend = None
     self.strategy = None
     self.name = None
     self.complete_url = None
     User.reset_cache()
     TestUserSocialAuth.reset_cache()
     TestNonce.reset_cache()
     TestAssociation.reset_cache()
     TestCode.reset_cache()
Example #11
0
 def setUp(self):
     HTTPretty.enable()
     self.backend = module_member(self.backend_path)
     self.strategy = TestStrategy(self.backend, TestStorage)
     self.name = self.backend.name.upper().replace("-", "_")
     self.complete_url = self.strategy.build_absolute_uri(self.raw_complete_url.format(self.backend.name))
     backends = (self.backend_path, "social.tests.backends.test_broken.BrokenBackendAuth")
     self.strategy.set_settings({"SOCIAL_AUTH_AUTHENTICATION_BACKENDS": backends})
     self.strategy.set_settings(self.extra_settings())
     # Force backends loading to trash PSA cache
     load_backends(backends, force_load=True)
     User.reset_cache()
     TestUserSocialAuth.reset_cache()
     TestNonce.reset_cache()
     TestAssociation.reset_cache()
     TestCode.reset_cache()
Example #12
0
 def test_disconnect_with_association_id(self):
     self.do_login()
     user = User.get(self.expected_username)
     user.password = '******'
     association_id = user.social[0].id
     second_usa = TestUserSocialAuth(user, user.social[0].provider, "uid2")
     self.assertEqual(len(user.social), 2)
     do_disconnect(self.backend, user, association_id)
     self.assertEqual(len(user.social), 1)
     self.assertEqual(user.social[0], second_usa)
Example #13
0
 def setUp(self):
     HTTPretty.enable()
     self.backend = module_member(self.backend_path)
     self.strategy = TestStrategy(self.backend, TestStorage)
     self.name = self.backend.name.upper().replace('-', '_')
     self.complete_url = self.strategy.build_absolute_uri(
         self.raw_complete_url.format(self.backend.name))
     backends = (self.backend_path,
                 'social.tests.backends.test_broken.BrokenBackendAuth')
     self.strategy.set_settings(
         {'SOCIAL_AUTH_AUTHENTICATION_BACKENDS': backends})
     self.strategy.set_settings(self.extra_settings())
     # Force backends loading to trash PSA cache
     load_backends(backends, force_load=True)
     User.reset_cache()
     TestUserSocialAuth.reset_cache()
     TestNonce.reset_cache()
     TestAssociation.reset_cache()
     TestCode.reset_cache()