<commit_before>from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from django.test.utils import override_settings

from controlcenter import widgets

from . import TestCase


@override_settings(CONTROLCENTER_DASHBOARDS=())
class A_DashboardTest(TestCase):
    # Must be first
    # 'cause @override_settings doesn't override settings well :(

    def setUp(self):
        self.superuser = User.objects.create_superuser(
            'superuser', '<EMAIL>', '<PASSWORD>')
        self.user = User.objects.create_user(
            'user', '<EMAIL>', 'password')

    def test_no_dashboard_found(self):
        self.client.login(username='superuser', password='<PASSWORD>')
        with self.assertRaises(ImproperlyConfigured):
            self.client.get(reverse('controlcenter:dashboard',
                                    kwargs={'pk': 0}))


class B_DashboardTest(TestCase):<commit_msg>Fix incompatible reverse import in tests<commit_after>from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured
from django.test.utils import override_settings

try:
    from django.urls import reverse
except ImportError:
    from django.core.urlresolvers import reverse

from controlcenter import widgets

from . import TestCase


@override_settings(CONTROLCENTER_DASHBOARDS=())
class A_DashboardTest(TestCase):
    # Must be first
    # 'cause @override_settings doesn't override settings well :(

    def setUp(self):
        self.superuser = User.objects.create_superuser(
            'superuser', '<EMAIL>', '<PASSWORD>')
        self.user = User.objects.create_user(
            'user', '<EMAIL>', 'password')

    def test_no_dashboard_found(self):
        self.client.login(username='superuser', password='<PASSWORD>')
        with self.assertRaises(ImproperlyConfigured):
            self.client.get(reverse('controlcenter:dashboard',
                                    kwargs={'pk': 0}))


class B_DashboardTest(TestCase):
{'fraction_non_alphanumeric': 0.10354885755955275, 'fraction_numerical': 0.0009722897423432182, 'mean_word_length': 3.6040268456375837, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7116635', 'n_tokens_mistral': 581, 'n_tokens_neox': 572, 'n_words': 127}