@@ -123,7 +123,7 @@ def test_validate_article(self):
123123
124124 f = BlogSearchForm ()
125125 f .search ()
126- self .client .login (username = 'liangliangyy' , password = 'liangliangyy' )
126+ # self.client.login(username='liangliangyy', password='liangliangyy')
127127 from DjangoBlog .spider_notify import SpiderNotify
128128 SpiderNotify .baidu_notify ([article .get_full_url ()])
129129
@@ -149,7 +149,9 @@ def test_validate_article(self):
149149 self .assertEqual (response .status_code , 200 )
150150 from DjangoBlog .utils import block_code
151151 block = block_code ("`python`" , 'python' )
152-
152+ self .client .get ("/admin/blog/article/1/delete/" )
153+ self .client .get ('/admin/servermanager/emailsendlog/' )
154+ self .client .get ('admin/admin/logentry/' )
153155
154156 def __check_pagination__ (self , p , type , value ):
155157 s = load_pagination_info (p .page (1 ), type , value )
@@ -182,18 +184,12 @@ def test_image(self):
182184 form_data = {'python.png' : imgfile }
183185 rsp = self .client .post (
184186 '/upload?sign=' + sign , form_data , follow = True )
185-
186187 self .assertEqual (rsp .status_code , 200 )
188+ os .remove (imagepath )
187189 from DjangoBlog .utils import save_user_avatar , send_email
188190 send_email (['qq@qq.com' ], 'testTitle' , 'testContent' )
189191 save_user_avatar (
190192 'https://www.python.org/static/img/python-logo@2x.png' )
191- """
192- data = SimpleUploadedFile(imagepath, b'file_content', content_type='image/jpg')
193- rsp = self.client.post('/upload', {'django.jpg': data})
194- self.assertEqual(rsp.status_code, 200)
195- SimpleUploadedFile()
196- """
197193
198194 def test_errorpage (self ):
199195 rsp = self .client .get ('/eee' )
0 commit comments