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

from django.test import TestCase

from geozones.factories import LocationFactory, RegionFactory
from geozones.forms import LocationForm


class TestLocationForm(TestCase):
    """ Test forms for input locations """

    def setUp(self):
        region = RegionFactory()
        self.data = LocationFactory.attributes()
        self.data['region'] = region.pk

    def test_complete_form(self):
        form = LocationForm(data=self.data)
        self.assertTrue(form.is_bound)
        self.assertTrue(form.is_valid())

    def test_no_region(self):
        self.data['region'] = None
        form = LocationForm(data=self.data)
        self.assertFalse(form.is_valid())<commit_msg>Тесты модуля geozones работают корректно<commit_after># -*- coding: utf-8 -*-

from django.test import TestCase

from geozones.factories import LocationFactory, RegionFactory
from geozones.forms import LocationForm


class TestLocationForm(TestCase):
    """ Test forms for input locations """

    def setUp(self):
        region = RegionFactory()
        self.data = LocationFactory.attributes()
        self.data['region'] = region.pk

    def test_complete_form(self):
        form = LocationForm(data=self.data)
        self.assertTrue(form.is_bound)
        self.assertTrue(form.is_valid())

    def test_no_region(self):
        self.data['region'] = None
        form = LocationForm(data=self.data)
        self.assertTrue(form.is_valid())
{'fraction_non_alphanumeric': 0.11035422343324251, 'fraction_numerical': 0.0013623978201634877, 'mean_word_length': 3.282798833819242, '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': '2995544', 'n_tokens_mistral': 424, 'n_tokens_neox': 423, 'n_words': 91}