Esempio n. 1
0
 def recheck(self):
     from etools.applications.management.issues.checks import get_issue_check_by_id  # noqa
     check = get_issue_check_by_id(self.issue_id)
     try:
         check.run_check(self.content_object, metadata=check.get_object_metadata(self.content_object))
     except IssueFoundException as e:
         # don't change status unless it was marked resolved
         if self.issue_status == ISSUE_STATUS_RESOLVED:
             self.issue_status = ISSUE_STATUS_REACTIVATED
         self.message = str(e)
         self.save()
     else:
         self.issue_status = ISSUE_STATUS_RESOLVED
         self.save()
Esempio n. 2
0
 def recheck(self):
     from etools.applications.management.issues.checks import get_issue_check_by_id  # noqa
     check = get_issue_check_by_id(self.issue_id)
     try:
         check.run_check(self.content_object,
                         metadata=check.get_object_metadata(
                             self.content_object))
     except IssueFoundException as e:
         # don't change status unless it was marked resolved
         if self.issue_status == ISSUE_STATUS_RESOLVED:
             self.issue_status = ISSUE_STATUS_REACTIVATED
         self.message = str(e)
         self.save()
     else:
         self.issue_status = ISSUE_STATUS_RESOLVED
         self.save()
Esempio n. 3
0
 def test_get_issue_check_by_id_not_found(self):
     with self.assertRaises(IssueCheckNotFoundException):
         checks.get_issue_check_by_id('not_found')
Esempio n. 4
0
 def test_get_issue_check_by_id(self):
     check = checks.get_issue_check_by_id(
         PartnersMustHaveShortNameTestCheck.check_id)
     self.assertTrue(type(check) == PartnersMustHaveShortNameTestCheck)
Esempio n. 5
0
 def test_get_issue_check_by_id_not_found(self):
     with self.assertRaises(IssueCheckNotFoundException):
         checks.get_issue_check_by_id('not_found')
Esempio n. 6
0
 def test_get_issue_check_by_id(self):
     check = checks.get_issue_check_by_id(PartnersMustHaveShortNameTestCheck.check_id)
     self.assertTrue(type(check) == PartnersMustHaveShortNameTestCheck)