Exemplo n.º 1
0
    def test_create_project_active(self):
        idCustomer = Customer.objects.filter(name='Intern')[0].id
        request = self.factory.post('/projects/', {'name': 'testTest', 'description': 'Desc', 'status': 1, 'responsible': self.user.id, 'customer': idCustomer, 'billing': 0, 'budget': 1000, 'hourly_rate': 100})

        self.user.is_superuser = True
        request.user = self.user

        views.projects(request)
        today = datetime.date(datetime.datetime.today().year, datetime.datetime.today().month, datetime.datetime.today().day)
        project = Project.objects.get(name = 'testTest')
        self.assertEqual(project.start, today)
Exemplo n.º 2
0
    def test_show_projects_denied(self):
        request = self.factory.get('/acquisition_counter/')

        request.user = self.user

        response = views.projects(request)
        self.assertEqual(response.status_code, 302)
Exemplo n.º 3
0
    def test_show_projects_denied(self):
        request = self.factory.get('/acquisition_counter/')

        request.user = self.user

        response = views.projects(request)
        self.assertEqual(response.status_code, 302)
Exemplo n.º 4
0
    def test_show_projects(self):
        request = self.factory.get('/acquisition_counter/')

        self.user.is_superuser = True
        request.user = self.user

        response = views.projects(request)
        self.assertEqual(response.status_code, 200)
Exemplo n.º 5
0
    def test_show_projects(self):
        request = self.factory.get('/acquisition_counter/')

        self.user.is_superuser = True
        request.user = self.user

        response = views.projects(request)
        self.assertEqual(response.status_code, 200)
Exemplo n.º 6
0
    def test_create_project(self):
        idCustomer = Customer.objects.filter(name='Intern')[0].id
        request = self.factory.post('/projects/', {'name': 'testTest', 'description': 'Desc', 'status': 0, 'responsible': self.user.id, 'customer': idCustomer, 'billing': 0, 'budget': 1000, 'hourly_rate': 100})

        self.user.is_superuser = True
        request.user = self.user

        response = views.projects(request)
        projects = len(Project.objects.all())
        #print(response)
        self.assertEqual(projects, 2)
Exemplo n.º 7
0
    def test_create_project_active(self):
        idCustomer = Customer.objects.filter(name='Intern')[0].id
        request = self.factory.post(
            '/projects/', {
                'name': 'testTest',
                'description': 'Desc',
                'status': 1,
                'responsible': self.user.id,
                'customer': idCustomer,
                'billing': 0,
                'budget': 1000,
                'hourly_rate': 100
            })

        self.user.is_superuser = True
        request.user = self.user

        views.projects(request)
        today = datetime.date(datetime.datetime.today().year,
                              datetime.datetime.today().month,
                              datetime.datetime.today().day)
        project = Project.objects.get(name='testTest')
        self.assertEqual(project.start, today)
Exemplo n.º 8
0
    def test_create_project(self):
        idCustomer = Customer.objects.filter(name='Intern')[0].id
        request = self.factory.post(
            '/projects/', {
                'name': 'testTest',
                'description': 'Desc',
                'status': 0,
                'responsible': self.user.id,
                'customer': idCustomer,
                'billing': 0,
                'budget': 1000,
                'hourly_rate': 100
            })

        self.user.is_superuser = True
        request.user = self.user

        response = views.projects(request)
        projects = len(Project.objects.all())
        #print(response)
        self.assertEqual(projects, 2)