|
|
|
|
@ -162,7 +162,7 @@ class ArticleTest(TestCase):
|
|
|
|
|
def test_image(self):
|
|
|
|
|
import requests
|
|
|
|
|
rsp = requests.get(
|
|
|
|
|
'https://www.python.org/static/img/python-logo@2x.png')
|
|
|
|
|
'https://www.python.org/static/img/python-logo.png')
|
|
|
|
|
imagepath = os.path.join(settings.BASE_DIR, 'python.png')
|
|
|
|
|
with open(imagepath, 'wb') as file:
|
|
|
|
|
file.write(rsp.content)
|
|
|
|
|
@ -180,7 +180,7 @@ class ArticleTest(TestCase):
|
|
|
|
|
from djangoblog.utils import save_user_avatar, send_email
|
|
|
|
|
send_email(['qq@qq.com'], 'testTitle', 'testContent')
|
|
|
|
|
save_user_avatar(
|
|
|
|
|
'https://www.python.org/static/img/python-logo@2x.png')
|
|
|
|
|
'https://www.python.org/static/img/python-logo.png')
|
|
|
|
|
|
|
|
|
|
def test_errorpage(self):
|
|
|
|
|
rsp = self.client.get('/eee')
|
|
|
|
|
|