From 77ac4f16e2e996190c692adbae56ade6b8f429d1 Mon Sep 17 00:00:00 2001 From: liangliang Date: Tue, 22 May 2018 23:13:09 +0800 Subject: [PATCH] update test image url --- blog/tests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/blog/tests.py b/blog/tests.py index d938034..c328df6 100644 --- a/blog/tests.py +++ b/blog/tests.py @@ -151,13 +151,13 @@ class ArticleTest(TestCase): def test_image(self): import requests - rsp = requests.get('https://www.lylinux.net/static/blog/img/avatar.png') - imagepath = os.path.join(settings.BASE_DIR, 'django.jpg') + rsp = requests.get('https://www.python.org/static/img/python-logo@2x.png') + imagepath = os.path.join(settings.BASE_DIR, 'python.png') with open(imagepath, 'wb') as file: file.write(rsp.content) with open(imagepath, 'rb') as file: - imgfile = SimpleUploadedFile('django.jpg', file.read(), content_type='image/jpg') - form_data = {'django.jpg': imgfile} + imgfile = SimpleUploadedFile('python.png', file.read(), content_type='image/jpg') + form_data = {'python.png': imgfile} rsp = self.client.post('/upload', form_data, follow=True) self.assertEqual(rsp.status_code, 200)