mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-23 08:36:32 +00:00
Expands automod view test
This commit is contained in:
parent
574c1db732
commit
7a9d320afd
2 changed files with 6 additions and 2 deletions
|
@ -53,6 +53,11 @@ class AutomodViews(TestCase):
|
|||
request.user.is_superuser = True
|
||||
|
||||
result = view(request)
|
||||
|
||||
self.assertIsInstance(result, TemplateResponse)
|
||||
validate_html(result.render())
|
||||
self.assertEqual(result.status_code, 200)
|
||||
|
||||
rule = models.AutoMod.objects.get()
|
||||
self.assertTrue(rule.flag_users)
|
||||
self.assertFalse(rule.flag_statuses)
|
||||
|
|
|
@ -33,8 +33,7 @@ class AutoMod(View):
|
|||
def post(self, request):
|
||||
"""add rule"""
|
||||
form = forms.AutoModRuleForm(request.POST)
|
||||
success = form.is_valid()
|
||||
if success:
|
||||
if form.is_valid():
|
||||
form.save()
|
||||
form = forms.AutoModRuleForm()
|
||||
|
||||
|
|
Loading…
Reference in a new issue