<commit_before>from django.contrib.auth.models import User, Group
from rest_framework.test import APITestCase
from patient.models import Patient


class AngelikaAPITestCase(APITestCase):

    def setUp(self):
        health_professional_group = Group.objects.create(name='health-professionals')
        Group.objects.create(name='patients')

        health_professional_user = User.objects.create_user('helselise', '<EMAIL>', 'test')
        health_professional_user.save()
        health_professional_user.groups.add(health_professional_group)

        self.create_patient('larsoverhaug', 'Lars', 'Overhaug')

    def create_patient(self, username, first_name, last_name):
        patient_user = User.objects.create_user(username, username + '@hotmail.com', 'test')
        patient_user.first_name = first_name
        patient_user.last_name = last_name
        patient_user.save()
        patient_user.groups.add(Group.objects.get(name='patients'))
        patient = Patient.objects.create(
            hub_id='hub-trd-1',
            user=patient_user,
            national_identification_number='02094523456',
            phone_number='45763984',
            address='arbeiderveien',
            zip_code='0030',
            city='Oslo',<commit_msg>Fix test case that broke because we changed patient-hub relation<commit_after>from django.contrib.auth.models import User, Group
from rest_framework.test import APITestCase
from patient.models import Patient


class AngelikaAPITestCase(APITestCase):

    def setUp(self):
        health_professional_group = Group.objects.create(name='health-professionals')
        Group.objects.create(name='patients')

        health_professional_user = User.objects.create_user('helselise', '<EMAIL>', 'test')
        health_professional_user.save()
        health_professional_user.groups.add(health_professional_group)

        self.create_patient('larsoverhaug', 'Lars', 'Overhaug')

    def create_patient(self, username, first_name, last_name):
        patient_user = User.objects.create_user(username, username + '@hotmail.<EMAIL>', 'test')
        patient_user.first_name = first_name
        patient_user.last_name = last_name
        patient_user.save()
        patient_user.groups.add(Group.objects.get(name='patients'))
        patient = Patient.objects.create(
            user=patient_user,
            national_identification_number='02094523456',
            phone_number='45763984',
            address='arbeiderveien',
            zip_code='0030',
            city='Oslo',
{'fraction_non_alphanumeric': 0.1047844998022934, 'fraction_numerical': 0.018584420719652037, 'mean_word_length': 3.4858156028368796, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '4071783', 'n_tokens_mistral': 776, 'n_tokens_neox': 712, 'n_words': 115}