<commit_before>from settings import *

if "motif" in DATABASES:
    del DATABASES["motif"]

TEST_RUNNER = "xmlrunner.extra.djangotestrunner.XMLTestRunner"
TEST_OUTPUT_VERBOSE = True
TEST_OUTPUT_DESCRIPTIONS = True
TEST_OUTPUT_DIR = "xmlrunner"
<commit_msg>Update test settings to create the unaccent ext if needed<commit_after>from settings import *

if "motif" in DATABASES:
    del DATABASES["motif"]

from xmlrunner.extra.djangotestrunner import XMLTestRunner
from django.test.runner import DiscoverRunner
from django.db import connections, DEFAULT_DB_ALIAS

# We use the XMLTestRunner on CI
class DunyaTestRunner(XMLTestRunner):
#class DunyaTestRunner(DiscoverRunner):
    def setup_databases(self):
        result = super(DunyaTestRunner, self).setup_databases()
        connection = connections[DEFAULT_DB_ALIAS]
        cursor = connection.cursor()
        cursor.execute('CREATE EXTENSION IF NOT EXISTS UNACCENT')
        return result

TEST_RUNNER = "dunya.test_settings.DunyaTestRunner"
TEST_OUTPUT_VERBOSE = True
TEST_OUTPUT_DESCRIPTIONS = True
TEST_OUTPUT_DIR = "xmlrunner"

{'fraction_non_alphanumeric': 0.072744014732965, 'fraction_numerical': 0.0, 'mean_word_length': 5.431952662721893, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '732811', 'n_tokens_mistral': 352, 'n_tokens_neox': 341, 'n_words': 83}