<commit_before>import os
from io import StringIO


from django.test import TestCase
from django.test import Client
from test.api import APIClient
from django.test.utils import setup_test_environment


from squad.core import models


tests_file = os.path.join(os.path.dirname(__file__), 'tests.json')
metrics_file = os.path.join(os.path.dirname(__file__), 'benchmarks.json')
log_file = os.path.join(os.path.dirname(__file__), 'test_run.log')
metadata_file = os.path.join(os.path.dirname(__file__), 'metadata.json')


def invalid_json():
    return StringIO('{')


class ApiTest(TestCase):

    def setUp(self):
        setup_test_environment()

        self.group = models.Group.objects.create(slug='mygroup')
        self.project = self.group.projects.create(slug='myproject')
        self.project.tokens.create(key='thekey')<commit_msg>test.api: drop explicit call to django.test.utils.setup_test_environment<commit_after>import os
from io import StringIO


from django.test import TestCase
from django.test import Client
from test.api import APIClient


from squad.core import models


tests_file = os.path.join(os.path.dirname(__file__), 'tests.json')
metrics_file = os.path.join(os.path.dirname(__file__), 'benchmarks.json')
log_file = os.path.join(os.path.dirname(__file__), 'test_run.log')
metadata_file = os.path.join(os.path.dirname(__file__), 'metadata.json')


def invalid_json():
    return StringIO('{')


class ApiTest(TestCase):

    def setUp(self):

        self.group = models.Group.objects.create(slug='mygroup')
        self.project = self.group.projects.create(slug='myproject')
        self.project.tokens.create(key='thekey')
{'fraction_non_alphanumeric': 0.1281117182756527, 'fraction_numerical': 0.0, 'mean_word_length': 4.7421602787456445, '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': '720188', 'n_tokens_mistral': 526, 'n_tokens_neox': 521, 'n_words': 103}