コード例 #1
0
ファイル: test_tasks.py プロジェクト: tilacog/paranoid
 def test_validator_is_instantiated_with_the_right_arguments(self):
     validate_document(self.mock_doc.pk)
     self.mock_validator_cls.assert_called_once_with(
         file_path = os.path.abspath(os.path.join(
             '../media', self.mock_doc.file.name
         )),
         mime=self.mock_doc.doctype.mime,
         encoding=self.mock_doc.doctype.encoding,
     )
コード例 #2
0
ファイル: test_tasks.py プロジェクト: tilacog/paranoid
 def test_validator_run_method_is_called(self):
     validate_document(self.mock_doc.pk)
     self.mock_validator.run.assert_called_once_with()
コード例 #3
0
ファイル: test_tasks.py プロジェクト: tilacog/paranoid
 def test_can_fetch_the_right_document(self):
     validate_document(self.mock_doc.pk)
     self.mock_doc_cls.objects.get.assert_called_once_with(pk=self.mock_doc.pk)