<commit_before>import datetime

from django.test import TestCase
from members.models import *

class MemberTest(TestCase):
    def setUp(self):
        Member.objects.create(given_names="<NAME>", preferred_name="Foo", surname="Tester")

    def test_get_full_name(self):
        foobar = Member.objects.get(given_names="<NAME>", surname="Tester")
        self.assertEqual(foobar._get_full_name(), "<NAME>")

    def test_get_full_preferred_name(self):
        foobar = Member.objects.get(given_names="<NAME>", surname="Tester")
        self.assertEqual(foobar._get_full_preferred_name(), "<NAME>")

    def test_str(self):
        foobar = Member.objects.get(given_names="<NAME>", surname="Tester")
        self.assertEqual(str(foobar), "Foo Bar Tester")

class DecorationOwnerShipTest(TestCase):
    def setUp(self):
        member = Member.objects.create(given_names="<NAME>", preferred_name="Foo", surname="Tester")
        decoration = Decoration.objects.create(name="Test Decoration")
        DecorationOwnership.objects.create(member=member, decoration=decoration, acquired=datetime.date.today())

    def test_str(self):
        dec_ownership = DecorationOwnership.objects.get(pk=1)
        self.assertEqual(str(dec_ownership), "Test Decoration - Foo Bar Tester")

class DecorationTest(TestCase):
    def setUp(self):
        Decoration.objects.create(name="Test Decoration")

    def test_str(self):
        decoration = Decoration.objects.get(pk=1)
        self.assertEqual(str(decoration), "Test Decoration")

class GroupTest(TestCase):
    def setUp(self):
        group_type = GroupType.objects.create(name="Group Type")
        Group.objects.create(grouptype=group_type, begin_date=datetime.date(2016, 11, 6), end_date=datetime.date(2016, 11, 8))

    def test_str(self):
        group = Group.objects.get(pk=1)
        self.assertEqual(str(group), "Group Type: 2016-11-06 - 2016-11-08")<commit_msg>Add group type test<commit_after>import datetime

from django.test import TestCase
from members.models import *

class MemberTest(TestCase):
    def setUp(self):
        Member.objects.create(given_names="<NAME>", preferred_name="Foo", surname="Tester")

    def test_get_full_name(self):
        foobar = Member.objects.get(given_names="<NAME>", surname="Tester")
        self.assertEqual(foobar._get_full_name(), "<NAME>")

    def test_get_full_preferred_name(self):
        foobar = Member.objects.get(given_names="<NAME>", surname="Tester")
        self.assertEqual(foobar._get_full_preferred_name(), "Foo Tester")

    def test_str(self):
        foobar = Member.objects.get(given_names="<NAME>", surname="Tester")
        self.assertEqual(str(foobar), "Foo Bar Tester")

class DecorationOwnerShipTest(TestCase):
    def setUp(self):
        member = Member.objects.create(given_names="<NAME>", preferred_name="Foo", surname="Tester")
        decoration = Decoration.objects.create(name="Test Decoration")
        DecorationOwnership.objects.create(member=member, decoration=decoration, acquired=datetime.date.today())

    def test_str(self):
        dec_ownership = DecorationOwnership.objects.get(pk=1)
        self.assertEqual(str(dec_ownership), "Test Decoration - Foo Bar Tester")

class DecorationTest(TestCase):
    def setUp(self):
        Decoration.objects.create(name="Test Decoration")

    def test_str(self):
        decoration = Decoration.objects.get(pk=1)
        self.assertEqual(str(decoration), "Test Decoration")

class GroupTest(TestCase):
    def setUp(self):
        group_type = GroupType.objects.create(name="Group Type")
        Group.objects.create(grouptype=group_type, begin_date=datetime.date(2016, 11, 6), end_date=datetime.date(2016, 11, 8))

    def test_str(self):
        group = Group.objects.get(pk=1)
        self.assertEqual(str(group), "Group Type: 2016-11-06 - 2016-11-08")

class GroupTypeTest(TestCase):
    def setUp(self):
        GroupType.objects.create(name="Group Type")

    def test_str(self):
        group_type = GroupType.objects.get(name="Group Type")
        self.assertEqual(str(group_type), "Group Type")
{'fraction_non_alphanumeric': 0.13424791768740812, 'fraction_numerical': 0.016168544830965213, 'mean_word_length': 4.254826254826255, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, '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': '344690', 'n_tokens_mistral': 1340, 'n_tokens_neox': 1230, 'n_words': 215}