コード例 #1
0
    def test_post_comment_on_report(self):
        """Test post comment on report."""
        # Test with anonymous user.
        c = Client()
        ReportFactory.create(user=self.user,
                             empty=True,
                             mentor=self.mentor,
                             month=datetime.date(2012, 1, 1))
        report_view_url = reverse('reports_view_report',
                                  kwargs={
                                      'display_name': self.up.display_name,
                                      'year': '2012',
                                      'month': 'January'
                                  })
        response = c.post(report_view_url, {'comment': 'This is comment'},
                          follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'error')

        # Test with logged in user.
        c.login(username='******', password='******')
        response = c.post(report_view_url, {'comment': 'This is comment'},
                          follow=True)
        self.assertTemplateUsed(response, 'view_report.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'success')
        self.assertIn('This is comment', response.content)
コード例 #2
0
ファイル: test_views.py プロジェクト: hoosteeno/remo
    def test_post_comment_on_report(self):
        """Test post comment on report."""
        # Test with anonymous user.
        c = Client()
        ReportFactory.create(user=self.user, empty=True, mentor=self.mentor,
                             month=datetime.date(2012, 1, 1))
        report_view_url = reverse('reports_view_report',
                                  kwargs={'display_name': self.up.display_name,
                                          'year': '2012',
                                          'month': 'January'})
        response = c.post(report_view_url, {'comment': 'This is comment'},
                          follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'error')

        # Test with logged in user.
        c.login(username='******', password='******')
        response = c.post(report_view_url, {'comment': 'This is comment'},
                          follow=True)
        self.assertTemplateUsed(response, 'view_report.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'success')
        self.assertIn('This is comment', response.content)
コード例 #3
0
    def test_send_email_on_edit_report_with_receive_mail_True(self):
        """Test sending an email when a report is edited

           and Mentor has the option in his/her settings enabled.
        """
        self.mentor_profile.receive_email_on_edit_report = True
        self.mentor_profile.save()

        ReportFactory.create(user=self.user, mentor=self.mentor)
        eq_(len(mail.outbox), 1)
コード例 #4
0
ファイル: test_models.py プロジェクト: josephbosire/remo
    def test_send_email_on_edit_report_with_receive_mail_True(self):
        """Test sending an email when a report is edited

           and Mentor has the option in his/her settings enabled.
        """
        self.mentor_profile.receive_email_on_edit_report = True
        self.mentor_profile.save()

        ReportFactory.create(user=self.user, mentor=self.mentor)
        eq_(len(mail.outbox), 1)
コード例 #5
0
    def test_send_email_on_edit_report_with_receive_mail_False(self):
        """Test sending an email when a report is edited.

           Default option: False
        """
        self.mentor_profile.receive_email_on_edit_report = False
        self.mentor_profile.receive_email_on_add_report = False
        self.mentor_profile.save()

        ReportFactory.create(user=self.user, mentor=self.mentor)
        eq_(len(mail.outbox), 0)
コード例 #6
0
ファイル: test_util.py プロジェクト: josephbosire/remo
 def setUp(self):
     """Initialize data for the tests."""
     self.mentor = UserFactory.create(username='******',
                                      groups=['Mentor'])
     self.user = UserFactory.create(
         username='******', groups=['Rep'], userprofile__mentor=self.mentor,
         userprofile__date_joined_program=date(2011, 1, 1))
     ReportFactory.create(user=self.user, month=date(2012, 1, 1),
                          empty=False, overdue=True)
     ReportFactory.create(user=self.user, month=date(2012, 2, 1),
                          empty=True, overdue=False)
コード例 #7
0
    def test_delete_report(self):
        """Test delete report."""
        c = Client()
        ReportFactory.create(user=self.user,
                             empty=True,
                             mentor=self.mentor,
                             month=datetime.date(2012, 2, 1))
        delete_url = reverse('reports_delete_report',
                             kwargs={
                                 'display_name': self.up.display_name,
                                 'year': '2012',
                                 'month': 'February'
                             })
        tmp_data = self.data.copy()
        tmp_data['delete_report'] = True

        # Test with anonymous user.
        response = c.post(delete_url, tmp_data, follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'warning')

        # Test with logged in user.
        c.login(username='******', password='******')
        response = c.post(delete_url, tmp_data, follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'error')

        # Test with owner.
        c.login(username='******', password='******')
        response = c.post(delete_url, tmp_data, follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'error')

        # Test with mentor.
        c.login(username='******', password='******')
        response = c.post(delete_url, tmp_data, follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'error')

        # Test with admin.
        c.login(username='******', password='******')
        response = c.post(delete_url, tmp_data, follow=True)
        self.assertTemplateUsed(response, 'profiles_view.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'success')
コード例 #8
0
ファイル: test_models.py プロジェクト: josephbosire/remo
    def test_send_email_on_edit_report_with_receive_mail_False(self):
        """Test sending an email when a report is edited.

           Default option: False
        """
        self.mentor_profile.receive_email_on_edit_report = False
        self.mentor_profile.receive_email_on_add_report = False
        self.mentor_profile.save()

        ReportFactory.create(user=self.user, mentor=self.mentor)
        eq_(len(mail.outbox), 0)
コード例 #9
0
ファイル: test_views.py プロジェクト: hoosteeno/remo
 def test_view_report_page(self):
     """Test view report page."""
     # check that there is comment
     # check that there is comment form
     ReportFactory.create(user=self.user, empty=True, mentor=self.mentor,
                          month=datetime.date(2012, 1, 1))
     c = Client()
     response = c.get(reverse('reports_view_report',
                              kwargs={'display_name': self.up.display_name,
                                      'year': '2012',
                                      'month': 'January'}))
     self.assertTemplateUsed(response, 'view_report.html')
コード例 #10
0
ファイル: test_views.py プロジェクト: hoosteeno/remo
    def test_delete_report(self):
        """Test delete report."""
        c = Client()
        ReportFactory.create(user=self.user, empty=True, mentor=self.mentor,
                             month=datetime.date(2012, 2, 1))
        delete_url = reverse('reports_delete_report',
                             kwargs={'display_name': self.up.display_name,
                                     'year': '2012',
                                     'month': 'February'})
        tmp_data = self.data.copy()
        tmp_data['delete_report'] = True

        # Test with anonymous user.
        response = c.post(delete_url, tmp_data, follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'warning')

        # Test with logged in user.
        c.login(username='******', password='******')
        response = c.post(delete_url, tmp_data, follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'error')

        # Test with owner.
        c.login(username='******', password='******')
        response = c.post(delete_url, tmp_data, follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'error')

        # Test with mentor.
        c.login(username='******', password='******')
        response = c.post(delete_url, tmp_data, follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'error')

        # Test with admin.
        c.login(username='******', password='******')
        response = c.post(delete_url, tmp_data, follow=True)
        self.assertTemplateUsed(response, 'profiles_view.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'success')
コード例 #11
0
    def test_view_edit_report_page(self):
        """Test view edit report page."""
        # test my edit report
        # test without permission other user's
        # test with permission other user's
        # test with report from the future
        ReportFactory.create(user=self.user,
                             empty=True,
                             mentor=self.mentor,
                             month=datetime.date(2011, 2, 1))

        edit_page_url = reverse('reports_edit_report',
                                kwargs={
                                    'display_name': self.up.display_name,
                                    'year': '2011',
                                    'month': 'February'
                                })

        # Try to access edit report page as anonymous.
        c = Client()
        response = c.get(edit_page_url, follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'warning')

        # Try to access edit report page as owner.
        c.login(username='******', password='******')
        response = c.get(edit_page_url, follow=True)
        self.assertTemplateUsed(response, 'edit_report.html')

        # Try to access edit report page as admin.
        c.login(username='******', password='******')
        response = c.get(edit_page_url, follow=True)
        self.assertTemplateUsed(response, 'edit_report.html')

        # Try to access edit report page as user's mentor.
        c.login(username='******', password='******')
        response = c.get(edit_page_url, follow=True)
        self.assertTemplateUsed(response, 'edit_report.html')

        # Try to access edit report page as other user.
        c.login(username='******', password='******')
        response = c.get(edit_page_url, follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'error')
コード例 #12
0
ファイル: test_views.py プロジェクト: hoosteeno/remo
    def test_delete_comment(self):
        """Test delete report comment."""
        report = ReportFactory.create(user=self.user, empty=True,
                                      mentor=self.mentor,
                                      month=datetime.date(2012, 2, 1))
        ReportCommentFactory.create(report=report, id=9, user=self.user)
        c = Client()
        delete_url = reverse('reports_delete_report_comment',
                             kwargs={'display_name': self.up.display_name,
                                     'year': '2012',
                                     'month': 'February',
                                     'comment_id': '9'})

        # Test with anonymous user.
        response = c.post(delete_url, {}, follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'warning')

        # Test with other user.
        c.login(username='******', password='******')
        response = c.post(delete_url, {}, follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'error')

        # Test with owner.
        c.login(username='******', password='******')
        response = c.post(delete_url, {}, follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'error')

        # Test with user's mentor.
        c.login(username='******', password='******')
        response = c.post(delete_url, {}, follow=True)
        self.assertTemplateUsed(response, 'view_report.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'success')
        ok_(not ReportComment.objects.filter(pk=9).exists())

        # Test with admin.
        ReportCommentFactory.create(report=report, id=10, user=self.user)
        delete_url = reverse('reports_delete_report_comment',
                             kwargs={'display_name': self.up.display_name,
                                     'year': '2012',
                                     'month': 'February',
                                     'comment_id': '10'})
        c.login(username='******', password='******')
        response = c.post(delete_url, {}, follow=True)
        self.assertTemplateUsed(response, 'view_report.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'success')
        ok_(not ReportComment.objects.filter(pk=10).exists())
コード例 #13
0
 def setUp(self):
     """Initialize data for the tests."""
     self.mentor = UserFactory.create(username='******',
                                      groups=['Mentor'])
     self.user = UserFactory.create(username='******',
                                    groups=['Rep'],
                                    userprofile__mentor=self.mentor,
                                    userprofile__date_joined_program=date(
                                        2011, 1, 1))
     ReportFactory.create(user=self.user,
                          month=date(2012, 1, 1),
                          empty=False,
                          overdue=True)
     ReportFactory.create(user=self.user,
                          month=date(2012, 2, 1),
                          empty=True,
                          overdue=False)
コード例 #14
0
 def test_view_report_page(self):
     """Test view report page."""
     # check that there is comment
     # check that there is comment form
     ReportFactory.create(user=self.user,
                          empty=True,
                          mentor=self.mentor,
                          month=datetime.date(2012, 1, 1))
     c = Client()
     response = c.get(
         reverse('reports_view_report',
                 kwargs={
                     'display_name': self.up.display_name,
                     'year': '2012',
                     'month': 'January'
                 }))
     self.assertTemplateUsed(response, 'view_report.html')
コード例 #15
0
ファイル: test_views.py プロジェクト: hoosteeno/remo
    def test_view_edit_report_page(self):
        """Test view edit report page."""
        # test my edit report
        # test without permission other user's
        # test with permission other user's
        # test with report from the future
        ReportFactory.create(user=self.user, empty=True, mentor=self.mentor,
                             month=datetime.date(2011, 2, 1))

        edit_page_url = reverse('reports_edit_report',
                                kwargs={'display_name': self.up.display_name,
                                        'year': '2011',
                                        'month': 'February'})

        # Try to access edit report page as anonymous.
        c = Client()
        response = c.get(edit_page_url, follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'warning')

        # Try to access edit report page as owner.
        c.login(username='******', password='******')
        response = c.get(edit_page_url, follow=True)
        self.assertTemplateUsed(response, 'edit_report.html')

        # Try to access edit report page as admin.
        c.login(username='******', password='******')
        response = c.get(edit_page_url, follow=True)
        self.assertTemplateUsed(response, 'edit_report.html')

        # Try to access edit report page as user's mentor.
        c.login(username='******', password='******')
        response = c.get(edit_page_url, follow=True)
        self.assertTemplateUsed(response, 'edit_report.html')

        # Try to access edit report page as other user.
        c.login(username='******', password='******')
        response = c.get(edit_page_url, follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'error')
コード例 #16
0
ファイル: test_models.py プロジェクト: josephbosire/remo
 def setUp(self):
     self.date = datetime.datetime.now()
     self.mentor = UserFactory.create(username='******',
                                      groups=['Mentor'])
     self.user = UserFactory.create(username='******', groups=['Rep'],
                                    userprofile__mentor=self.mentor)
     self.month_year = datetime.date(year=2012, month=1, day=10)
     self.new_report = ReportFactory.build(
         user=self.user, month=self.date,
         mentor=self.user.userprofile.mentor)
     self.mentor_profile = self.mentor.userprofile
コード例 #17
0
ファイル: test_models.py プロジェクト: josephbosire/remo
    def test_overdue_true_2(self, fake_requests_obj):
        """Test overdue report (second test)."""
        today = datetime.datetime.today()

        # act like it's OVERDUE_DAY + 1
        fake_date = datetime.datetime(year=today.year, month=today.month,
                                      day=OVERDUE_DAY + 1)
        (fake_requests_obj.expects_call().returns(fake_date))

        month_year = go_back_n_months(today)
        report = ReportFactory.create(user=self.user, month=month_year)
        eq_(report.overdue, True)
コード例 #18
0
ファイル: test_models.py プロジェクト: josephbosire/remo
 def setUp(self):
     """Setup tests."""
     self.new_mentor = UserFactory.create(username='******',
                                          groups=['Mentor'])
     self.user_mentor = UserFactory.create(username='******',
                                           groups=['Mentor'])
     self.user = UserFactory.create(username='******', groups=['Rep'],
                                    userprofile__mentor=self.user_mentor)
     self.month_year = datetime.date(year=2012, month=1, day=10)
     self.report = ReportFactory.create(user=self.user,
                                        month=self.month_year,
                                        mentor=self.user.userprofile.mentor)
コード例 #19
0
ファイル: test_views.py プロジェクト: hoosteeno/remo
    def test_view_current_report_page(self):
        """Test view report page."""
        # If anonymous, return an error.
        c = Client()
        response = c.get(reverse('reports_view_current_report'), follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'warning')

        # Login.
        c.login(username='******', password='******')

        # If report does not exist, render edit page.
        response = c.get(reverse('reports_view_current_report'), follow=True)
        self.assertTemplateUsed(response, 'edit_report.html')

        # If report exists, render report.
        ReportFactory.create(user=self.user, empty=True, mentor=self.mentor,
                             month=go_back_n_months(datetime.date.today()))
        response = c.get(reverse('reports_view_current_report'), follow=True)
        self.assertTemplateUsed(response, 'view_report.html')
コード例 #20
0
 def setUp(self):
     self.date = datetime.datetime.now()
     self.mentor = UserFactory.create(username='******',
                                      groups=['Mentor'])
     self.user = UserFactory.create(username='******',
                                    groups=['Rep'],
                                    userprofile__mentor=self.mentor)
     self.month_year = datetime.date(year=2012, month=1, day=10)
     self.new_report = ReportFactory.build(
         user=self.user,
         month=self.date,
         mentor=self.user.userprofile.mentor)
     self.mentor_profile = self.mentor.userprofile
コード例 #21
0
 def setUp(self):
     """Setup tests."""
     self.new_mentor = UserFactory.create(username='******',
                                          groups=['Mentor'])
     self.user_mentor = UserFactory.create(username='******',
                                           groups=['Mentor'])
     self.user = UserFactory.create(username='******',
                                    groups=['Rep'],
                                    userprofile__mentor=self.user_mentor)
     self.month_year = datetime.date(year=2012, month=1, day=10)
     self.report = ReportFactory.create(user=self.user,
                                        month=self.month_year,
                                        mentor=self.user.userprofile.mentor)
コード例 #22
0
    def test_overdue_true_2(self, fake_requests_obj):
        """Test overdue report (second test)."""
        today = datetime.datetime.today()

        # act like it's OVERDUE_DAY + 1
        fake_date = datetime.datetime(year=today.year,
                                      month=today.month,
                                      day=OVERDUE_DAY + 1)
        (fake_requests_obj.expects_call().returns(fake_date))

        month_year = go_back_n_months(today)
        report = ReportFactory.create(user=self.user, month=month_year)
        ok_(report.overdue)
コード例 #23
0
ファイル: test_models.py プロジェクト: josephbosire/remo
    def test_overdue_false_2(self, fake_requests_obj):
        """Test not overdue report (first test)."""
        # marginal case
        today = datetime.datetime.today()

        # act like it's OVERDUE_DAY
        fake_date = datetime.datetime(year=today.year, month=today.month,
                                      day=OVERDUE_DAY)
        (fake_requests_obj.expects_call().returns(fake_date))

        month_year = go_back_n_months(today)
        report = ReportFactory.create(user=self.user, month=month_year)
        eq_(report.overdue, False)
コード例 #24
0
    def test_overdue_false_2(self, fake_requests_obj):
        """Test not overdue report (first test)."""
        # marginal case
        today = datetime.datetime.today()

        # act like it's OVERDUE_DAY
        fake_date = datetime.datetime(year=today.year,
                                      month=today.month,
                                      day=OVERDUE_DAY)
        (fake_requests_obj.expects_call().returns(fake_date))

        month_year = go_back_n_months(today)
        report = ReportFactory.create(user=self.user, month=month_year)
        ok_(not report.overdue)
コード例 #25
0
    def test_view_current_report_page(self):
        """Test view report page."""
        # If anonymous, return an error.
        c = Client()
        response = c.get(reverse('reports_view_current_report'), follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'warning')

        # Login.
        c.login(username='******', password='******')

        # If report does not exist, render edit page.
        response = c.get(reverse('reports_view_current_report'), follow=True)
        self.assertTemplateUsed(response, 'edit_report.html')

        # If report exists, render report.
        ReportFactory.create(user=self.user,
                             empty=True,
                             mentor=self.mentor,
                             month=go_back_n_months(datetime.date.today()))
        response = c.get(reverse('reports_view_current_report'), follow=True)
        self.assertTemplateUsed(response, 'view_report.html')
コード例 #26
0
ファイル: test_models.py プロジェクト: josephbosire/remo
 def setUp(self):
     self.date = datetime.datetime.now()
     self.mentor = UserFactory.create(
         username='******', groups=['Mentor'],
         userprofile__receive_email_on_add_report=False)
     self.user = UserFactory.create(username='******', groups=['Rep'],
                                    userprofile__mentor=self.mentor)
     self.user_profile = self.user.userprofile
     self.report = ReportFactory.create(user=self.user,
                                        month=self.date,
                                        mentor=self.user.userprofile.mentor)
     self.new_comment = ReportCommentFactory.build(user=self.mentor,
                                                   created_on=self.date,
                                                   report=self.report)
     self.month_year = datetime.date(year=2012, month=1, day=10)
コード例 #27
0
 def setUp(self):
     self.date = datetime.datetime.now()
     self.mentor = UserFactory.create(
         username='******',
         groups=['Mentor'],
         userprofile__receive_email_on_add_report=False)
     self.user = UserFactory.create(username='******',
                                    groups=['Rep'],
                                    userprofile__mentor=self.mentor)
     self.user_profile = self.user.userprofile
     self.report = ReportFactory.create(user=self.user,
                                        month=self.date,
                                        mentor=self.user.userprofile.mentor)
     self.new_comment = ReportCommentFactory.build(user=self.mentor,
                                                   created_on=self.date,
                                                   report=self.report)
     self.month_year = datetime.date(year=2012, month=1, day=10)
コード例 #28
0
ファイル: test_models.py プロジェクト: josephbosire/remo
 def test_overdue_false(self):
     """Test not overdue report (first test)."""
     # Change report created_on, so report is not overdue
     month_year = datetime.date(year=2020, month=1, day=10)
     report = ReportFactory.create(user=self.user, month=month_year)
     eq_(report.overdue, False)
コード例 #29
0
    def test_delete_comment(self):
        """Test delete report comment."""
        report = ReportFactory.create(user=self.user,
                                      empty=True,
                                      mentor=self.mentor,
                                      month=datetime.date(2012, 2, 1))
        ReportCommentFactory.create(report=report, id=9, user=self.user)
        c = Client()
        delete_url = reverse('reports_delete_report_comment',
                             kwargs={
                                 'display_name': self.up.display_name,
                                 'year': '2012',
                                 'month': 'February',
                                 'comment_id': '9'
                             })

        # Test with anonymous user.
        response = c.post(delete_url, {}, follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'warning')

        # Test with other user.
        c.login(username='******', password='******')
        response = c.post(delete_url, {}, follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'error')

        # Test with owner.
        c.login(username='******', password='******')
        response = c.post(delete_url, {}, follow=True)
        self.assertTemplateUsed(response, 'main.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'error')

        # Test with user's mentor.
        c.login(username='******', password='******')
        response = c.post(delete_url, {}, follow=True)
        self.assertTemplateUsed(response, 'view_report.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'success')
        ok_(not ReportComment.objects.filter(pk=9).exists())

        # Test with admin.
        ReportCommentFactory.create(report=report, id=10, user=self.user)
        delete_url = reverse('reports_delete_report_comment',
                             kwargs={
                                 'display_name': self.up.display_name,
                                 'year': '2012',
                                 'month': 'February',
                                 'comment_id': '10'
                             })
        c.login(username='******', password='******')
        response = c.post(delete_url, {}, follow=True)
        self.assertTemplateUsed(response, 'view_report.html')
        for m in response.context['messages']:
            pass
        eq_(m.tags, u'success')
        ok_(not ReportComment.objects.filter(pk=10).exists())
コード例 #30
0
 def test_overdue_false(self):
     """Test not overdue report (first test)."""
     # Change report created_on, so report is not overdue
     month_year = datetime.date(year=2020, month=1, day=10)
     report = ReportFactory.create(user=self.user, month=month_year)
     ok_(not report.overdue)