<commit_before>"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".

Replace this with more appropriate tests for your application.
"""

from datetime import datetime

from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import override_settings

from base.models import UserProfile, ProfileRequest
from utils.funcs import convert_to_url
from utils.variables import ANONYMOUS_USERNAME, MESSAGES
from managers.cron import ExpireRequestsCronJob
from managers.models import Manager, RequestType, Request, Response, Announcement

class TestPermissions(TestCase):
    def setUp(self):
        self.u = User.objects.create_user(username="u", password="<PASSWORD>")
        self.st = User.objects.create_user(username="st", password="<PASSWORD>")
        self.pu = User.objects.create_user(username="pu", password="<PASSWORD>")
        self.su = User.objects.create_user(username="su", password="<PASSWORD>")
        self.np = User.objects.create_user(username="np", password="<PASSWORD>")

        self.st.is_staff = True
        self.su.is_staff, self.su.is_superuser = True, True

        self.u.save()
        self.st.save()
        self.pu.save()
        self.su.save()
        self.np.save()

        self.m = Manager.objects.create(<commit_msg>Fixed failing test<commit_after>"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".

Replace this with more appropriate tests for your application.
"""

from datetime import datetime

from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import override_settings
from django.utils.timezone import now

from base.models import UserProfile, ProfileRequest
from utils.funcs import convert_to_url
from utils.variables import ANONYMOUS_USERNAME, MESSAGES
from managers.cron import ExpireRequestsCronJob
from managers.models import Manager, RequestType, Request, Response, Announcement

class TestPermissions(TestCase):
    def setUp(self):
        self.u = User.objects.create_user(username="u", password="<PASSWORD>")
        self.st = User.objects.create_user(username="st", password="<PASSWORD>")
        self.pu = User.objects.create_user(username="pu", password="<PASSWORD>")
        self.su = User.objects.create_user(username="su", password="<PASSWORD>")
        self.np = User.objects.create_user(username="np", password="<PASSWORD>")

        self.st.is_staff = True
        self.su.is_staff, self.su.is_superuser = True, True

        self.u.save()
        self.st.save()
        self.pu.save()
        self.su.save()
        self.np.save()

        self.m = Manager.objects.create(
{'fraction_non_alphanumeric': 0.10637548432546672, 'fraction_numerical': 0.0, 'mean_word_length': 3.991212653778559, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '7103819', 'n_tokens_mistral': 807, 'n_tokens_neox': 809, 'n_words': 215}