def test_random_file_name_with_id(self): obj = RandomFileName("submission_files/submission_{id}") filepath = obj.__call__(self.submission, self.test_file_path) expected = "submission_files/submission_{}/{}".format( self.submission.pk, filepath.split("/")[2]) self.assertEqual(filepath, expected)
def test_random_file_name_without_id(self): obj = RandomFileName("evaluation_scripts") filepath = obj.__call__(self.challenge, self.test_file_path) expected = "evaluation_scripts/{}".format(filepath.split('/')[1]) self.assertEqual(filepath, expected)