Skip to content

Commit 77ac4f1

Browse files
committed
update test image url
1 parent ef17958 commit 77ac4f1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

blog/tests.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ def test_validate_feed(self):
151151

152152
def test_image(self):
153153
import requests
154-
rsp = requests.get('https://www.lylinux.net/static/blog/img/avatar.png')
155-
imagepath = os.path.join(settings.BASE_DIR, 'django.jpg')
154+
rsp = requests.get('https://www.python.org/static/img/python-logo@2x.png')
155+
imagepath = os.path.join(settings.BASE_DIR, 'python.png')
156156
with open(imagepath, 'wb') as file:
157157
file.write(rsp.content)
158158
with open(imagepath, 'rb') as file:
159-
imgfile = SimpleUploadedFile('django.jpg', file.read(), content_type='image/jpg')
160-
form_data = {'django.jpg': imgfile}
159+
imgfile = SimpleUploadedFile('python.png', file.read(), content_type='image/jpg')
160+
form_data = {'python.png': imgfile}
161161
rsp = self.client.post('/upload', form_data, follow=True)
162162

163163
self.assertEqual(rsp.status_code, 200)

0 commit comments

Comments
 (0)