# Path: tests/testapp/factories.py
# class EntryFactory(DjangoModelFactory):
#     class Meta:
#         model = Entry
# 
#     is_active = True
#     is_featured = False
# 
# def create_category(title):
#     category = CategoryFactory.create()
#     CategoryTranslationFactory.create(parent=category, title=title, slug=slugify(title))
#     return category
# 
# def create_entries(factory):
#     tz = zoneinfo.ZoneInfo(settings.TIME_ZONE)
#     author = UserFactory()
#     entries = []
#     date1 = datetime.datetime(2012, 8, 12, 11, 0, 0, tzinfo=tz)
#     delta = datetime.timedelta(hours=4)
#     date2 = datetime.datetime(2012, 10, 12, 11, 1, 0, tzinfo=tz)
# 
#     entries.append(
#         factory.create(
#             pk=1,
#             author=author,
#             title="Entry 1",
#             published_on=date1,
#             last_changed=date1 + delta,
#             slug="entry-1",
#             language="en",
#         )
#     )
#     entries.append(
#         factory.create(
#             pk=2,
#             author=author,
#             title="Eintrag 1",
#             published_on=date2,
#             last_changed=date2 + delta,
#             slug="eintrag-1",
#             language="en",
#         )
#     )
#     return entries


from django.template.loader import render_to_string
from django.test import TransactionTestCase
from django.test.utils import override_settings
from .factories import EntryFactory, create_category, create_entries



class TemplateTagsTest(TransactionTestCase):
    def setUp(self):
        entries = create_entries(EntryFactory)

# Path: tests/testapp/factories.py
# class EntryFactory(DjangoModelFactory):
#     class Meta:
#         model = Entry
# 
#     is_active = True
#     is_featured = False
# 
# def create_category(title):
#     category = CategoryFactory.create()
#     CategoryTranslationFactory.create(parent=category, title=title, slug=slugify(title))
#     return category
# 
# def create_entries(factory):
#     tz = zoneinfo.ZoneInfo(settings.TIME_ZONE)
#     author = UserFactory()
#     entries = []
#     date1 = datetime.datetime(2012, 8, 12, 11, 0, 0, tzinfo=tz)
#     delta = datetime.timedelta(hours=4)
#     date2 = datetime.datetime(2012, 10, 12, 11, 1, 0, tzinfo=tz)
# 
#     entries.append(
#         factory.create(
#             pk=1,
#             author=author,
#             title="Entry 1",
#             published_on=date1,
#             last_changed=date1 + delta,
#             slug="entry-1",
#             language="en",
#         )
#     )
#     entries.append(
#         factory.create(
#             pk=2,
#             author=author,
#             title="Eintrag 1",
#             published_on=date2,
#             last_changed=date2 + delta,
#             slug="eintrag-1",
#             language="en",
#         )
#     )
#     return entries


# Path: tests/testapp/test_templatetags.py
from django.template.loader import render_to_string
from django.test import TransactionTestCase
from django.test.utils import override_settings
from .factories import EntryFactory, create_category, create_entries




class TemplateTagsTest(TransactionTestCase):
    def setUp(self):
        entries = create_entries(EntryFactory)

        category = create_category(title="Category 1")