<commit_before># -*- coding: utf-8 -*-
import pytest

from components.events.models import Event, Performance, Venue
from components.events.factories import (EventFactory, PerformanceFactory,
    VenueFactory)

pytestmark = pytest.mark.django_db


class TestEvents:
    def test_factory(self):
        factory = EventFactory()
        assert isinstance(factory, Event)
        assert 'event' in factory.romanized_name


class TestPerformances:
    def test_factory(self):
        factory = PerformanceFactory()
        assert isinstance(factory, Performance)
        assert 'performance' in factory.romanized_name


class TestVenues:
    def test_factory(self):
        factory = VenueFactory()
        assert isinstance(factory, Venue)
        assert 'venue' in factory.romanized_name<commit_msg>Test string representations and get_absolute_url() calls.<commit_after># -*- coding: utf-8 -*-
import datetime
import pytest

from components.events.models import Event, Performance, Venue
from components.events.factories import (EventFactory, PerformanceFactory,
    VenueFactory)

pytestmark = pytest.mark.django_db


class TestEvents:
    def test_factory(self):
        factory = EventFactory()
        assert isinstance(factory, Event)
        assert 'event' in factory.romanized_name

    def test_get_absolute_url(self, client):
        factory = EventFactory()
        response = client.get(factory.get_absolute_url())
        assert response.status_code == 200


class TestPerformances:
    def test_factory(self):
        factory = PerformanceFactory()
        assert isinstance(factory, Performance)
        assert 'performance' in factory.romanized_name

    def test_string_representation(self):
        day = datetime.date.today()
        performance = PerformanceFactory()
        assert str(day) in str(performance)

        start_time = datetime.datetime.now().time()
        performance_with_start_time = PerformanceFactory(start_time=start_time)
        assert str(start_time) in str(performance_with_start_time)


class TestVenues:
    def test_factory(self):
        factory = VenueFactory()
        assert isinstance(factory, Venue)
        assert 'venue' in factory.romanized_name

    def test_get_absolute_url(self, client):
        factory = VenueFactory()
        response = client.get(factory.get_absolute_url())
        assert response.status_code == 200

    def test_string_representation(self):
        factory = VenueFactory()
        assert str(factory) == factory.romanized_name
{'fraction_non_alphanumeric': 0.08247011952191236, 'fraction_numerical': 0.0031872509960159364, 'mean_word_length': 3.5080789946140034, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4642516', 'n_tokens_mistral': 688, 'n_tokens_neox': 667, 'n_words': 167}