修改测试中使用相对id的地方,原来测试里用了很多id是自己设置的常量,可能引发了错误

This commit is contained in:
sxw@401
2015-09-05 16:25:05 +08:00
parent fd0d5be3bf
commit 75b1bf749e
3 changed files with 11 additions and 11 deletions

View File

@@ -144,7 +144,7 @@ class ProblemAdminTest(APITestCase):
self.assertEqual(response.data, {"code": 1, "data": u"题目不存在"})
def test_query_problem_exists(self):
data = {"problem_id": 1}
data = {"problem_id": self.problem.id}
response = self.client.get(self.url, data=data)
self.assertEqual(response.data["code"], 0)