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) diff --git a/requirements.txt b/requirements.txt index 6234f5e..0e5aed9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,7 +21,7 @@ olefile==0.45.1 packaging==17.1 Pillow==5.1.0 Pygments==2.2.0 -PyMySQL==0.8.0 +PyMySQL==0.8.1 pyparsing==2.2.0 python-memcached==1.59 python-slugify==1.2.5 @@ -34,6 +34,6 @@ sqlparse==0.2.4 Unidecode==1.0.22 urllib3==1.22 webencodings==0.5.1 -WeRoBot==1.4.0 +WeRoBot==1.4.1 Whoosh==2.7.4 xmltodict==0.11.0 diff --git a/templates/blog/article_detail.html b/templates/blog/article_detail.html index 45227e5..5231578 100755 --- a/templates/blog/article_detail.html +++ b/templates/blog/article_detail.html @@ -6,7 +6,7 @@ - + @@ -17,6 +17,14 @@ {% endfor %} + + + {% if article.tags %} + + {% else %} + + {% endif %} + {% endblock %} {% block content %}