def test_secure_authenticated_call_returns_a_405(self): request = Mock() setattr(request, 'is_secure', lambda:True) setattr(request, 'environ', {}) app = embed_wsgi(simple_wsgi) res = app(request) self.assertEqual(res.status_code, 405)
def test_unsecure_call_returns_a_400(self): request = Mock() setattr(request, 'is_secure', lambda:False) app = embed_wsgi(simple_wsgi) res = app(request) self.assertEqual(res.status_code, 400)