<commit_before>from django.test import TestCase
from phonenumber_field.modelfields import PhoneNumberField

from working_waterfronts.working_waterfronts_api.models import PointOfInterest
from django.contrib.gis.db import models


class PointOfInterestTestCase(TestCase):

    def setUp(self):
        self.expected_fields = {
            'name': models.TextField,
            'alt_name': models.TextField,
            'contact_name': models.TextField,
            'location': models.PointField,
            'street': models.TextField,
            'city': models.TextField,
            'state': models.TextField,
            'zip': models.TextField,
            'description': models.TextField,
            'history': models.TextField,
            'facts': models.TextField,
            'location_description': models.TextField,
            'website': models.URLField,
            'email': models.EmailField,
            'phone': PhoneNumberField,
            'categories': models.ManyToManyField,
            'pointofinterests_categories': models.ManyToManyField,
            'created': models.DateTimeField,
            'modified': models.DateTimeField,
            'id': models.AutoField
        }

        self.optional_fields = {
            'alt_name',
            'location_description',
            'website',
            'email',
            'phone'
        }

        self.null_fields = {'story', 'phone'}

    def test_fields_exist(self):
        model = models.get_model('working_waterfronts_api', 'PointOfInterest')
        for field, field_type in self.expected_fields.items():
            self.assertEqual(<commit_msg>Update POI model test with hazard MTM<commit_after>from django.test import TestCase
from phonenumber_field.modelfields import PhoneNumberField

from working_waterfronts.working_waterfronts_api.models import PointOfInterest
from django.contrib.gis.db import models


class PointOfInterestTestCase(TestCase):

    def setUp(self):
        self.expected_fields = {
            'name': models.TextField,
            'alt_name': models.TextField,
            'contact_name': models.TextField,
            'location': models.PointField,
            'street': models.TextField,
            'city': models.TextField,
            'state': models.TextField,
            'zip': models.TextField,
            'description': models.TextField,
            'history': models.TextField,
            'facts': models.TextField,
            'location_description': models.TextField,
            'website': models.URLField,
            'email': models.EmailField,
            'phone': PhoneNumberField,
            'hazards': models.ManyToManyField,
            'pointofinterests_hazards': models.ManyToManyField,
            'categories': models.ManyToManyField,
            'pointofinterests_categories': models.ManyToManyField,
            'created': models.DateTimeField,
            'modified': models.DateTimeField,
            'id': models.AutoField
        }

        self.optional_fields = {
            'alt_name',
            'location_description',
            'website',
            'email',
            'phone'
        }

        self.null_fields = {'story', 'phone'}

    def test_fields_exist(self):
        model = models.get_model('working_waterfronts_api', 'PointOfInterest')
        for field, field_type in self.expected_fields.items():
            self.assertEqual(
{'fraction_non_alphanumeric': 0.10002942041776994, 'fraction_numerical': 0.0, 'mean_word_length': 2.2535885167464116, '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': '1570048', 'n_tokens_mistral': 885, 'n_tokens_neox': 866, 'n_words': 171}