Exemple #1
0
    def test_delete_build_jobs(self):
        project1 = ProjectFactory()
        BuildJobFactory(project=project1)
        project1.archive()
        project2 = ProjectFactory()
        job2 = BuildJobFactory(project=project2)
        job2.archive()

        assert BuildJob.all.count() == 2

        CleaningIntervals.ARCHIVED = -10
        delete_archived_build_jobs()

        # Although the other entity is archived it's not deleted because of project1
        assert BuildJob.all.count() == 1
Exemple #2
0
    def test_delete_build_jobs(self):
        project1 = ProjectFactory()
        BuildJobFactory(project=project1)
        project1.archive()
        project2 = ProjectFactory()
        job2 = BuildJobFactory(project=project2)
        job2.archive()

        assert BuildJob.all.count() == 2

        conf.set(CLEANING_INTERVALS_ARCHIVES, -10)
        delete_archived_build_jobs()

        # Although the other entity is archived it's not deleted because of project1
        assert BuildJob.all.count() == 1