コード例 #1
0
    def test_add_data(self):
        "Test adding data directory to a project using management commands "

        data_directory = auth.join(__file__, "..", "data")

        data = auth.create_data(project=self.project, path=data_directory)

        self.assertTrue(os.path.exists(data.get_data_dir()), "Directory not being linked")
コード例 #2
0
    def test_job_files_paste(self):
        "Paste file from job results"
        management.call_command('job', id=self.job.id)

        url = reverse("files_paste", kwargs=dict(uid=self.project.uid))

        data = {}
        request = util.fake_request(url=url, data=data, user=self.owner)
        request.session["files_clipboard"] = [
            auth.join(self.job.path, "runlog")
        ]

        request.session["files_clipboard"].append(self.job.uid)

        response = views.files_paste(request=request, uid=self.project.uid)

        self.process_response(response=response, data=data)

        self.assertTrue(models.Data.save.called, "save() method called.")