<commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals

from datetime import timedelta

from django.test import TestCase
from django.contrib.auth.models import User

from .models import Timesheet, Task, Entry


class TimesheetTestCase(TestCase):
    def setUp(self):
        Timesheet.objects.create(name='Timestrap')

    def test_timesheet_created(self):
        timesheet = Timesheet.objects.get(name='Timestrap')
        self.assertEqual(timesheet.name, 'Timestrap')


class TaskTestCase(TestCase):
    timesheet = None

    def setUp(self):
        self.timesheet = Timesheet.objects.create(name='Timestrap')
        Task.objects.create(timesheet=self.timesheet, name='Testing')

    def test_task_created(self):
        task = Task.objects.get(name='Testing')
        self.assertEqual(task.name, 'Testing')
        self.assertEqual(task.timesheet, self.timesheet)


class EntryTestCase(TestCase):
    task = None
    user = None

    def setUp(self):
        timesheet = Timesheet.objects.create(name='Timestrap')
        self.task = Task.objects.create(timesheet=timesheet, name='Testing')
        self.user = User.objects.create_user('testuser', '<EMAIL>',
                '<PASSWORD>')
        Entry.objects.create(
            task=self.task,
            user=self.user,
            duration=timedelta(hours=1),
            note='Creating tests for the core app'
        )
        Entry.objects.create(
            task=self.task,
            user=self.user,
            duration=timedelta(hours=2),
            note='Continue creating tests for the core app'
        )<commit_msg>Fix E128 in core tests<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals

from datetime import timedelta

from django.test import TestCase
from django.contrib.auth.models import User

from .models import Timesheet, Task, Entry


class TimesheetTestCase(TestCase):
    def setUp(self):
        Timesheet.objects.create(name='Timestrap')

    def test_timesheet_created(self):
        timesheet = Timesheet.objects.get(name='Timestrap')
        self.assertEqual(timesheet.name, 'Timestrap')


class TaskTestCase(TestCase):
    timesheet = None

    def setUp(self):
        self.timesheet = Timesheet.objects.create(name='Timestrap')
        Task.objects.create(timesheet=self.timesheet, name='Testing')

    def test_task_created(self):
        task = Task.objects.get(name='Testing')
        self.assertEqual(task.name, 'Testing')
        self.assertEqual(task.timesheet, self.timesheet)


class EntryTestCase(TestCase):
    task = None
    user = None

    def setUp(self):
        timesheet = Timesheet.objects.create(name='Timestrap')
        self.task = Task.objects.create(timesheet=timesheet, name='Testing')
        self.user = User.objects.create_user('testuser', '<EMAIL>',
                                             '<PASSWORD>')
        Entry.objects.create(
            task=self.task,
            user=self.user,
            duration=timedelta(hours=1),
            note='Creating tests for the core app'
        )
        Entry.objects.create(
            task=self.task,
            user=self.user,
            duration=timedelta(hours=2),
            note='Continue creating tests for the core app'
        )
{'fraction_non_alphanumeric': 0.11077111383108935, 'fraction_numerical': 0.0027539779681762548, 'mean_word_length': 2.6896162528216703, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4387894', 'n_tokens_mistral': 942, 'n_tokens_neox': 914, 'n_words': 188}