forked from liangliangyy/DjangoBlog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request liangliangyy#79 from liangliangyy/dev
修改错误页面http状态码
- Loading branch information
Showing
5 changed files
with
26 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,13 @@ def test_validate_article(self): | |
s = load_articletags(article) | ||
self.assertIsNotNone(s) | ||
|
||
rsp = self.client.get('/refresh') | ||
self.assertEqual(rsp.status_code, 302) | ||
|
||
self.client.login(username='liangliangyy', password='liangliangyy') | ||
rsp = self.client.get('/refresh') | ||
self.assertEqual(rsp.status_code, 200) | ||
|
||
response = self.client.get(reverse('blog:archives')) | ||
self.assertEqual(response.status_code, 200) | ||
|
||
|
@@ -107,8 +114,7 @@ def test_validate_article(self): | |
self.client.login(username='liangliangyy', password='liangliangyy') | ||
from DjangoBlog.spider_notify import SpiderNotify | ||
SpiderNotify.baidu_notify([article.get_full_url()]) | ||
rsp = self.client.get('/refresh/') | ||
self.assertEqual(rsp.status_code, 200) | ||
|
||
from blog.templatetags.blog_tags import gravatar_url, gravatar | ||
u = gravatar_url('[email protected]') | ||
u = gravatar('[email protected]') | ||
|
@@ -132,6 +138,10 @@ def test_validate_feed(self): | |
user = BlogUser.objects.get_or_create(email="[email protected]", username="liangliangyy")[0] | ||
user.set_password("liangliangyy") | ||
user.save() | ||
self.client.login(username='liangliangyy', password='liangliangyy') | ||
|
||
rsp = self.client.get('/refresh') | ||
self.assertEqual(rsp.status_code, 403) | ||
|
||
response = self.client.get('/feed/') | ||
self.assertEqual(response.status_code, 200) | ||
|
@@ -159,5 +169,5 @@ def test_image(self): | |
""" | ||
|
||
def test_errorpage(self): | ||
self.client.get('/eee') | ||
self.client.get('/refresh_memcache') | ||
rsp = self.client.get('/eee') | ||
self.assertEqual(rsp.status_code, 404) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters