def test_source_ip_rate_limit_rate_no_header(self): req = self.rf.get("/") self.assertIsNone(views.source_ip_rate_limit_rate(None, req))
def test_source_ip_rate_limit_rate(self): req = self.rf.get("/", HTTP_X_SOURCE_IP="2.2.2.2") self.assertEqual(views.source_ip_rate_limit_rate(None, req), "40/m")
def test_source_ip_rate_limit_rate(self): req = self.rf.get('/', HTTP_X_SOURCE_IP='2.2.2.2') self.assertEqual(views.source_ip_rate_limit_rate(None, req), '40/m')