Пример #1
0
    def test_ReportingPeriodList_json_no_longer_employed(self):
        """ Check that the ReportingPeriodList shows users that have missing
        time cards """
        # Create a user, but set the user as unemployed
        self.regular_user = User.objects.create(username='******')
        userdata = UserData(user=self.regular_user)
        userdata.current_employee = False
        userdata.save()

        reporting_periods = client().get(reverse('ReportingPeriodList')).data
        start_date = reporting_periods[0]['start_date']
        res = client().get(
            reverse('ReportingPeriodAudit',
                    kwargs={'reporting_period_start_date': start_date})).data
        self.assertEqual(len(res), 0)
Пример #2
0
    def test_ReportingPeriodList_json_no_longer_employed(self):
        """ Check that the ReportingPeriodList shows users that have missing
        time cards """
        # Create a user, but set the user as unemployed
        self.regular_user = get_user_model().objects.create(
            username='******')
        userdata = UserData(user=self.regular_user)
        userdata.current_employee = False
        userdata.save()

        reporting_periods = self.app.get(reverse('ReportingPeriodList'))
        start_date = reporting_periods.json['results'][0]['start_date']
        res = self.app.get(reverse(
                'ReportingPeriodAudit',
                kwargs={'reporting_period_start_date': start_date}
            )
        )
        self.assertEqual(res.json['count'], 0)