def test_multiple_passes(self): req = RequestFactory().get('/') req.user = AnonymousUser() self.resource._meta.authentication = ( authentication.SharedSecretAuthentication(), # Optional auth passes because there are not auth headers. authentication.OptionalOAuthAuthentication()) eq_(self.resource.is_authenticated(req), None)
def test_single(self): req = RequestFactory().get('/[email protected],56b6f1a3dd735d962c56' 'ce7d8f46e02ec1d4748d2c00c407d75f0969d08bb' '9c68c31b3371aa8130317815c89e5072e31bb94b4' '121c5c165f3515838d4d6c60c4,165d631d3c3045' '458b4516242dad7ae') self.resource._meta.authentication = ( authentication.SharedSecretAuthentication()) eq_(self.resource.is_authenticated(req), None) eq_(self.profile.user.pk, req.amo_user.pk)
def setUp(self): self.auth = authentication.SharedSecretAuthentication() self.profile = UserProfile.objects.get(pk=2519) self.profile.update(email=self.profile.user.email)