<commit_before>from imp import reload
from django.test import TestCase
from django.db import IntegrityError

from mygpoauth.applications import models


class Applications(TestCase):

    def test_unique_client_id(self):

        # ensures that imports are considered in test coverage
        reload(models)

        app1 = models.Application.objects.create(name='app1', client_id='app')

        with self.assertRaises(IntegrityError):
            app2 = models.Application.objects.create(name='app2',
                                                     client_id='app')

    def test_str(self):
        app1 = models.Application.objects.create(name='app1', client_id='app')

        self.assertEquals(str(app1), app1.name)<commit_msg>Don't reload models for coverage purposes<commit_after>from imp import reload
from django.test import TestCase
from django.db import IntegrityError

from mygpoauth.applications import models


class Applications(TestCase):

    def test_unique_client_id(self):
        app1 = models.Application.objects.create(name='app1', client_id='app')

        with self.assertRaises(IntegrityError):
            app2 = models.Application.objects.create(name='app2',
                                                     client_id='app')

    def test_str(self):
        app1 = models.Application.objects.create(name='app1', client_id='app')

        self.assertEquals(str(app1), app1.name)
{'fraction_non_alphanumeric': 0.09476661951909476, 'fraction_numerical': 0.011315417256011316, 'mean_word_length': 2.908839779005525, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1761039', 'n_tokens_mistral': 387, 'n_tokens_neox': 366, 'n_words': 83}