File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -110,14 +110,14 @@ def test_ustc(self):
110110 self .c .logout ()
111111 resp = self .c .get ("/accounts/ustc/login/" , {"ticket" : "ST-1234567890" })
112112 self .assertRedirects (resp , reverse ("hub" ), target_status_code = 302 )
113- self .assert_ (auth .get_user (self .c ).is_authenticated )
113+ self .assertTrue (auth .get_user (self .c ).is_authenticated )
114114
115115 @mock .patch ("frontend.auth_providers.cas.urlopen" , new = mock_urlopen )
116116 def test_sustech (self ):
117117 self .c .logout ()
118118 resp = self .c .get ("/accounts/sustech/login/" , {"ticket" : "ST-1234567890" })
119119 self .assertRedirects (resp , reverse ("hub" ), target_status_code = 302 )
120- self .assert_ (auth .get_user (self .c ).is_authenticated )
120+ self .assertTrue (auth .get_user (self .c ).is_authenticated )
121121
122122
123123class AccountLogViewPermission (TestCase ):
@@ -141,7 +141,7 @@ def test_low_privilege(self):
141141 # get a ustc account
142142 self .c .logout ()
143143 resp = self .c .get ("/accounts/sustech/login/" , {"ticket" : "ST-1234567890" })
144- self .assert_ (auth .get_user (self .c ).is_authenticated )
144+ self .assertTrue (auth .get_user (self .c ).is_authenticated )
145145 resp = self .c .post (
146146 reverse ("account" ),
147147 data = json .dumps ({"method" : "accountlog" , "user" : self .u .pk }),
Original file line number Diff line number Diff line change @@ -96,16 +96,16 @@ def test_import(self):
9696 context = Context (elevated = True )
9797 challenges = {i .name : i for i in Challenge .get_all (context )}
9898 keys = challenges .keys ()
99- self .assert_ ("示例题目 1" not in keys )
100- self .assert_ ("示例题目 2" in keys )
101- self .assert_ ("示例题目 3" in keys )
99+ self .assertTrue ("示例题目 1" not in keys )
100+ self .assertTrue ("示例题目 2" in keys )
101+ self .assertTrue ("示例题目 3" in keys )
102102 c2 = challenges ["示例题目 2" ]
103103 c3 = challenges ["示例题目 3" ]
104- self .assert_ (c2 .url_orig .endswith ("/example.txt" ))
104+ self .assertTrue (c2 .url_orig .endswith ("/example.txt" ))
105105 self .assertEqual (c3 .url_orig , "http://example.com/?token={token}" )
106106 self .assertEqual (c2 .check_url_clicked , False )
107107 self .assertEqual (c3 .check_url_clicked , True )
108- self .assert_ ("codehilite" in c3 .detail )
108+ self .assertTrue ("codehilite" in c3 .detail )
109109 flag1 = c2 .flags [0 ]
110110 self .assertEqual (flag1 ["type" ], "expr" )
111111 self .assertEqual ("flag{2=2, 1:14}" , expr_flag (flag1 ["flag" ], "1:14" ))
You can’t perform that action at this time.
0 commit comments