# Path: boards/models.py
# class Board(models.Model):
#     name = models.CharField(max_length=30, unique=True)
#     description = models.CharField(max_length=100)
# 
#     def __str__(self):
#         return self.name
# 
#     def get_posts_count(self):
#         return Post.objects.filter(topic__board=self).count()
# 
#     def get_last_post(self):
#         return Post.objects.filter(topic__board=self).order_by('-created_at').first()
# 
# Path: boards/views.py
# class BoardListView(ListView):
#     model = Board
#     context_object_name = 'boards'
#     template_name = 'home.html'


from django.test import TestCase
from django.urls import resolve, reverse
from ..models import Board
from ..views import BoardListView



class HomeTests(TestCase):
    def setUp(self):
        self.board = Board.objects.create(name='Django', description='Django board.')
        url = reverse('home')
        self.response = self.client.get(url)


# Path: boards/models.py
# class Board(models.Model):
#     name = models.CharField(max_length=30, unique=True)
#     description = models.CharField(max_length=100)
# 
#     def __str__(self):
#         return self.name
# 
#     def get_posts_count(self):
#         return Post.objects.filter(topic__board=self).count()
# 
#     def get_last_post(self):
#         return Post.objects.filter(topic__board=self).order_by('-created_at').first()
# 
# Path: boards/views.py
# class BoardListView(ListView):
#     model = Board
#     context_object_name = 'boards'
#     template_name = 'home.html'


# Path: boards/tests/test_view_home.py
from django.test import TestCase
from django.urls import resolve, reverse
from ..models import Board
from ..views import BoardListView




class HomeTests(TestCase):
    def setUp(self):
        self.board = Board.objects.create(name='Django', description='Django board.')
        url = reverse('home')
        self.response = self.client.get(url)


    def test_home_view_status_code(self):