def test_failed_sql_alchemy_exception_integrity(self, mock_add): with self.assertRaises(Conflict): create(company)
def test_failed_sql_alchemy_exception(self, mock_add): with self.assertRaises(InternalServerError): create(company)
def test_success(self, mock_add, mock_commit): response = create(company) assert mock_add.called assert mock_commit.called assert company_validate.validate(response)