mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-01-04 03:22:06 +00:00
修复 account 里面的单元测试错误
This commit is contained in:
parent
d074296087
commit
fca5abaf6d
@ -280,7 +280,7 @@ class LoginRequiredDecoratorTest(TestCase):
|
|||||||
def test_cbv_without_args(self):
|
def test_cbv_without_args(self):
|
||||||
# 没登陆
|
# 没登陆
|
||||||
response = self.client.get("/login_required_test/cbv/1/")
|
response = self.client.get("/login_required_test/cbv/1/")
|
||||||
self.assertTemplateUsed(response, "utils/error.html")
|
self.assertRedirects(response, "/login/")
|
||||||
|
|
||||||
# 登陆后
|
# 登陆后
|
||||||
self.client.login(username="test", password="test")
|
self.client.login(username="test", password="test")
|
||||||
@ -353,7 +353,7 @@ class AdminRequiredDecoratorTest(TestCase):
|
|||||||
def test_cbv_without_args(self):
|
def test_cbv_without_args(self):
|
||||||
# 没登陆
|
# 没登陆
|
||||||
response = self.client.get("/admin_required_test/cbv/1/")
|
response = self.client.get("/admin_required_test/cbv/1/")
|
||||||
self.assertRedirects(response, "/login/")
|
self.assertTemplateUsed(response, "utils/error.html")
|
||||||
|
|
||||||
# 登陆后
|
# 登陆后
|
||||||
self.client.login(username="test", password="test")
|
self.client.login(username="test", password="test")
|
||||||
|
Loading…
Reference in New Issue
Block a user