Пример #1
0
def sanity_check():
    messages = sanity_checker.check_sanity()

    if len(messages) > 0:
        raise SanityFailedError(messages)
    else:
        return "No issues detected."
Пример #2
0
 def test_error_tostring(self):
     Document.objects.create(title="test",
                             checksum="dgfhj",
                             archive_checksum="dfhg",
                             content="",
                             pk=1,
                             filename="0000001.pdf",
                             archive_filename="0000001.pdf")
     string = str(SanityFailedError(check_sanity()))
     self.assertIsNotNone(string)
Пример #3
0
 def test_all(self):
     Document.objects.create(title="test", checksum="dgfhj", archive_checksum="dfhg", content="", pk=1, filename="0000001.pdf")
     string = str(SanityFailedError(check_sanity()))