创建文章
(self, title='测试文章', body='测试内容', author=None,
category=None, status='p', article_type='a')
| 70 | return tag |
| 71 | |
| 72 | def create_article(self, title='测试文章', body='测试内容', author=None, |
| 73 | category=None, status='p', article_type='a'): |
| 74 | """创建文章""" |
| 75 | if author is None: |
| 76 | author = self.user if hasattr(self, 'user') else self.create_user() |
| 77 | if category is None: |
| 78 | category = self.category if hasattr(self, 'category') else self.create_category() |
| 79 | |
| 80 | article = Article.objects.create( |
| 81 | title=title, |
| 82 | body=body, |
| 83 | author=author, |
| 84 | category=category, |
| 85 | type=article_type, |
| 86 | status=status |
| 87 | ) |
| 88 | return article |
| 89 | |
| 90 | def create_comment(self, article=None, author=None, body='测试评论', parent=None): |
| 91 | """创建评论""" |
no test coverage detected