def test_accepted(self): req = self.call() ok_(self.auth.is_authenticated(req)) if req.method in ['DELETE', 'PATCH', 'POST', 'PUT']: ok_(this_thread_is_pinned()) else: ok_(not this_thread_is_pinned())
def test_accepted(self): req = self.call() eq_(self.auth.authenticate(req), (self.profile.user, None)) if req.method in ['DELETE', 'PATCH', 'POST', 'PUT']: ok_(this_thread_is_pinned()) else: ok_(not this_thread_is_pinned())
def test_accepted(self): req = Request(self.call()) eq_(self.auth.authenticate(req), (self.profile.user, None)) if req.method in ['DELETE', 'PATCH', 'POST', 'PUT']: ok_(this_thread_is_pinned()) else: ok_(not this_thread_is_pinned())
def test_accepted(self): req = Request(self.call()) ok_(self.auth.is_authenticated(req)) if req.method in ['DELETE', 'PATCH', 'POST', 'PUT']: ok_(this_thread_is_pinned()) else: ok_(not this_thread_is_pinned())
def test_pinned_request_method(self): self.attach_user(anon=False) for method in ["DELETE", "PATCH", "POST", "PUT"]: self.req.method = method self.pin.process_request(self.req) ok_(this_thread_is_pinned()) for method in ["GET", "HEAD", "OPTIONS", "POOP"]: self.req.method = method self.pin.process_request(self.req) ok_(not this_thread_is_pinned())
def test_pinned_request_method(self): self.attach_user(anon=False) for method in ['DELETE', 'PATCH', 'POST', 'PUT']: self.req.method = method self.pin.process_request(self.req) ok_(this_thread_is_pinned()) for method in ['GET', 'HEAD', 'OPTIONS', 'POOP']: self.req.method = method self.pin.process_request(self.req) ok_(not this_thread_is_pinned())
def test_pinned_cached(self): cache.set(self.key, 1, 5) self.attach_user(anon=False) self.pin.process_request(self.req) ok_(this_thread_is_pinned()) cache.delete(self.key)
def test_not_pinned(self): self.req.amo_user.is_anonymous.return_value = True self.pin.process_request(self.req) ok_(not this_thread_is_pinned())
def test_accepted(self): ok_(self.auth.is_authenticated(self.call())) ok_(this_thread_is_pinned())
def test_not_pinned(self): self.attach_user(anon=True) self.pin.process_request(self.req) ok_(not this_thread_is_pinned())
def test_accepted(self): eq_(self.auth.authenticate(self.call()), (self.profile.user, None)) ok_(this_thread_is_pinned())