import re
from django.test import TestCase

from board.models import Post, Board, Comment
from accounts.models import Account


class BoardAppTest(TestCase):
    fixtures = ['test.json']

    @classmethod
    def setUpTestData(cls):
        super().setUpTestData()
        cls.default_board = Board.objects.get(id=1)
        cls.user = Account.objects.get(id=1)

    def login(self):
        user = Account.objects.get(id=1)
        self.client.login(username=user.username, password='kboard123')

    def remove_csrf(self, origin):
        csrf_regex = r'<input[^>]+csrfmiddlewaretoken[^>]+>'
        return re.sub(csrf_regex, '', origin)

@@ -3,16 +3,45 @@
 port re%0A
+from functools import wraps%0A%0A
 from dja
@@ -150,16 +150,181 @@
 count%0A%0A%0A
+def login_test_user(method):%0A    @wraps(method)%0A    def _impl(self, *args, **kwargs):%0A        self.login()%0A        method(self, *args, **kwargs)%0A%0A    return _impl%0A%0A%0A
 class Bo

Add login decorator on base unittest