<commit_before>from django.test import TestCase
from booking.models import Booking
from django.contrib.auth.models import User


class BookingTestCase(TestCase):
    def setUp(self):
        user1 = User.objects.create_user(
            'john', '<EMAIL>', '<PASSWORD>'
        )
        user1.save()
        user2 = User.objects.create_user(
            'johndow', '<EMAIL>', '<PASSWORD>'
        )
        user2.save()
        Booking.objects.create(
            title="test_booking",
            text="test_booking_text",
            price=150,
            customer=user1
        )

    def test_assigning_performer(self):
        """Checks that booking can be assigned to the performer"""
        booking = Booking.objects.get(title='test_booking')
        user = User.objects.get(username='johndow')
        booking.set_performer(user)
        booking.save()
        booking = Booking.objects.get(title='test_booking')
        self.assertEqual(booking.performer, user)<commit_msg>Дополнен тест для модели Booking.<commit_after>from django.test import TestCase
from booking.models import Booking
from django.contrib.auth.models import User


class BookingTestCase(TestCase):
    def setUp(self):
        user1 = User.objects.create_user(
            'john', '<EMAIL>', '<PASSWORD>'
        )
        user1.save()
        user2 = User.objects.create_user(
            'johndow', '<EMAIL>', '<PASSWORD>'
        )
        user2.save()
        Booking.objects.create(
            title="test_booking",
            text="test_booking_text",
            price=150,
            customer=user1
        )

    def test_booking_processing(self):
        """Checks that booking can be assigned to the performer"""
        booking = Booking.objects.get(title='test_booking')
        user = User.objects.get(username='johndow')
        booking.set_performer(user)
        booking.save()
        booking = Booking.objects.get(title='test_booking')
        self.assertEqual(booking.performer, user)
        booking.complete()
        booking.save()
        self.assertEqual(booking.status, Booking.COMPLETED)
{'fraction_non_alphanumeric': 0.1139723414401526, 'fraction_numerical': 0.007629947544110634, 'mean_word_length': 2.4225122349102772, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5866043', 'n_tokens_mistral': 615, 'n_tokens_neox': 618, 'n_words': 115}