def test_get_servers(self): params = {"cluster": "East"} request = self.factory.get("/get_servers", params) self.response = views.get_servers(request) # Verify content expected = json.dumps(["ec2-54-242-160-13.compute-1.amazonaws.com"]) self.assertEquals(self.response.content, expected)
def test_get_servers_wrong_param(self): params = {"cluster": "West"} request = self.factory.get("/get_servers", params) self.response = views.get_servers(request)
def test_get_servers_with_missing_param(self): request = self.factory.get("/get_servers") self.response = views.get_servers(request)