# Path: ctleweb/projtrack/report_generator.py
# def check_semester(sem):
#     try:
#         try:
#             return list(Project.objects.filter(semester=sem))
#         except TypeError:
#             return [Project.objects.filter(semester=sem)]
#     except ObjectDoesNotExist:
#         return []
# 
# def check_client(cli):
#     try:
#         try:
#             return list(Project.objects.filter(client=cli))
#         except TypeError:
#             return [Project.objects.filter(client=cli)]
#     except ObjectDoesNotExist:
#         return []
# 
# def check_department(depart):
#     try:
#         try:
#             cli = Client.objects.filter(department=depart)
#             return list(Project.objects.filter(client=cli))
#         except TypeError:
#             cli = Client.objects.filter(department=depart)
#             return [Project.objects.filter(client=cli)]
#     except ObjectDoesNotExist:
#         return []
# 
# def check_type(proj):
#     try:
#         try:
#             return list(Project.objects.filter(type=proj))
#         except TypeError:
#             return [Project.objects.filter(type=proj)]
#     except ObjectDoesNotExist:
#         return []


import datetime
import django.test
from django.contrib.auth.models import User as App_User
from projtrack.models import Client, Project, Type, User, Department, Semester
from .report_generator import check_semester, check_client, check_department, check_type

        use = User.objects.get(username="techconbob")
        sem = Semester.objects.get(name="Test2")
        self.assertEqual(check_semester(sem),
                         [Project.objects.get(users=use)])

    def test_get_client(self):
        cli = Client.objects.get(email="roberts@email.com")
        self.assertNotEqual('', str(cli))

    def test_check_client(self):
        sem = Client.objects.get(email="roberts@email.com")
        self.assertEqual(check_client(sem),
                         [Project.objects.get(client=sem)])

    def test_get_department(self):
        dept = Department.objects.get(name="Science")
        self.assertNotEqual('', str(dept))

    def test_check_department(self):
        sci = Department.objects.get(name="Science")
        cli = Client.objects.get(department=sci)
        self.assertEqual(check_department(sci),
                         [Project.objects.get(client=cli)])

    def test_get_type(self):
        typ = Type.objects.get(name="Project")
        self.assertNotEqual('', str(typ))

    def test_check_type(self):
        sem = Type.objects.get(name="Project")

# Path: ctleweb/projtrack/report_generator.py
# def check_semester(sem):
#     try:
#         try:
#             return list(Project.objects.filter(semester=sem))
#         except TypeError:
#             return [Project.objects.filter(semester=sem)]
#     except ObjectDoesNotExist:
#         return []
# 
# def check_client(cli):
#     try:
#         try:
#             return list(Project.objects.filter(client=cli))
#         except TypeError:
#             return [Project.objects.filter(client=cli)]
#     except ObjectDoesNotExist:
#         return []
# 
# def check_department(depart):
#     try:
#         try:
#             cli = Client.objects.filter(department=depart)
#             return list(Project.objects.filter(client=cli))
#         except TypeError:
#             cli = Client.objects.filter(department=depart)
#             return [Project.objects.filter(client=cli)]
#     except ObjectDoesNotExist:
#         return []
# 
# def check_type(proj):
#     try:
#         try:
#             return list(Project.objects.filter(type=proj))
#         except TypeError:
#             return [Project.objects.filter(type=proj)]
#     except ObjectDoesNotExist:
#         return []


# Path: ctleweb/projtrack/tests.py
import datetime
import django.test
from django.contrib.auth.models import User as App_User
from projtrack.models import Client, Project, Type, User, Department, Semester
from .report_generator import check_semester, check_client, check_department, check_type

        use = User.objects.get(username="techconbob")
        sem = Semester.objects.get(name="Test2")
        self.assertEqual(check_semester(sem),
                         [Project.objects.get(users=use)])

    def test_get_client(self):
        cli = Client.objects.get(email="roberts@email.com")
        self.assertNotEqual('', str(cli))

    def test_check_client(self):
        sem = Client.objects.get(email="roberts@email.com")
        self.assertEqual(check_client(sem),
                         [Project.objects.get(client=sem)])

    def test_get_department(self):
        dept = Department.objects.get(name="Science")
        self.assertNotEqual('', str(dept))

    def test_check_department(self):
        sci = Department.objects.get(name="Science")
        cli = Client.objects.get(department=sci)
        self.assertEqual(check_department(sci),
                         [Project.objects.get(client=cli)])

    def test_get_type(self):
        typ = Type.objects.get(name="Project")
        self.assertNotEqual('', str(typ))

    def test_check_type(self):
        sem = Type.objects.get(name="Project")

        self.assertEqual(check_type(sem),
