예제 #1
0
 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())
예제 #2
0
 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())
예제 #3
0
 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())
예제 #4
0
 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())
예제 #5
0
    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())
예제 #6
0
    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())
예제 #7
0
    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())
예제 #8
0
 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)
예제 #9
0
 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())
예제 #10
0
 def test_accepted(self):
     ok_(self.auth.is_authenticated(self.call()))
     ok_(this_thread_is_pinned())
예제 #11
0
 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())
예제 #12
0
 def test_not_pinned(self):
     self.attach_user(anon=True)
     self.pin.process_request(self.req)
     ok_(not this_thread_is_pinned())
예제 #13
0
 def test_accepted(self):
     eq_(self.auth.authenticate(self.call()), (self.profile.user, None))
     ok_(this_thread_is_pinned())
예제 #14
0
 def test_accepted(self):
     ok_(self.auth.is_authenticated(self.call()))
     ok_(this_thread_is_pinned())
예제 #15
0
 def test_not_pinned(self):
     self.attach_user(anon=True)
     self.pin.process_request(self.req)
     ok_(not this_thread_is_pinned())
예제 #16
0
 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)
예제 #17
0
 def test_accepted(self):
     eq_(self.auth.authenticate(self.call()), (self.profile.user, None))
     ok_(this_thread_is_pinned())