File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -151,13 +151,13 @@ def test_validate_feed(self):
151
151
152
152
def test_image (self ):
153
153
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 ' )
156
156
with open (imagepath , 'wb' ) as file :
157
157
file .write (rsp .content )
158
158
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 }
161
161
rsp = self .client .post ('/upload' , form_data , follow = True )
162
162
163
163
self .assertEqual (rsp .status_code , 200 )
You can’t perform that action at this time.
0 commit comments