From 8213478fb6a8d26476664cc7f242bc632e69b488 Mon Sep 17 00:00:00 2001 From: liangliangyy Date: Tue, 9 May 2023 16:17:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AF=84=E8=AE=BA=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comments/tests.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/comments/tests.py b/comments/tests.py index c34eb5b9..d503d0ad 100644 --- a/comments/tests.py +++ b/comments/tests.py @@ -6,7 +6,6 @@ from blog.models import Category, Article from comments.models import Comment from comments.templatetags.comments_tags import * -from djangoblog.utils import get_current_site from djangoblog.utils import get_max_articleid_commentid @@ -16,6 +15,10 @@ class CommentsTest(TestCase): def setUp(self): self.client = Client() self.factory = RequestFactory() + from blog.models import BlogSettings + value = BlogSettings() + value.comment_need_review = True + value.save() def update_article_comment_status(self, article): comments = article.comment_set.all() @@ -24,7 +27,6 @@ def update_article_comment_status(self, article): comment.save() def test_validate_comment(self): - site = get_current_site().domain user = BlogUser.objects.create_superuser( email="liangliangyy1@gmail.com", username="liangliangyy1",