コード例 #1
0
    def test_n_draft_with_drafts(self):
        """Test CACHE PROJECTS _n_draft returns 2 if there are 2 draft projects"""
        ProjectFactory.create_batch(2, published=False)

        number_of_drafts = cached_projects._n_draft()

        assert number_of_drafts == 2, number_of_drafts
コード例 #2
0
    def test_n_draft_no_drafts(self):
        """Test CACHE PROJECTS _n_draft returns 0 if there are no draft projects"""
        project = ProjectFactory.create(published=True)

        number_of_drafts = cached_projects._n_draft()

        assert number_of_drafts == 0, number_of_drafts
コード例 #3
0
    def test_n_draft_with_drafts(self):
        """Test CACHE PROJECTS _n_draft returns 2 if there are 2 draft projects"""
        ProjectFactory.create_batch(2, published=False)

        number_of_drafts = cached_projects._n_draft()

        assert number_of_drafts == 2, number_of_drafts
コード例 #4
0
    def test_n_draft_no_drafts(self):
        """Test CACHE PROJECTS _n_draft returns 0 if there are no draft projects"""
        project = ProjectFactory.create(published=True)

        number_of_drafts = cached_projects._n_draft()

        assert number_of_drafts == 0, number_of_drafts
コード例 #5
0
    def test_n_draft_with_drafts(self):
        """Test CACHE PROJECTS _n_draft returns 2 if there are 2 draft projects"""
        # Here, we are suposing that a project is draft iff has no presenter AND has no tasks

        ProjectFactory.create_batch(2, info={})

        number_of_drafts = cached_projects._n_draft()

        assert number_of_drafts == 2, number_of_drafts
コード例 #6
0
ファイル: test_cache_projects.py プロジェクト: ianthe/pybossa
    def test_n_draft_with_drafts(self):
        """Test CACHE PROJECTS _n_draft returns 2 if there are 2 draft projects"""
        # Here, we are suposing that a project is draft iff has no presenter AND has no tasks

        ProjectFactory.create_batch(2, info={})

        number_of_drafts = cached_projects._n_draft()

        assert number_of_drafts == 2, number_of_drafts
コード例 #7
0
    def test_n_draft_no_drafts(self):
        """Test CACHE PROJECTS _n_draft returns 0 if there are no draft projects"""
        # Here, we are suposing that a project is draft iff has no presenter AND has no tasks

        project = ProjectFactory.create(info={})
        TaskFactory.create_batch(2, project=project)

        number_of_drafts = cached_projects._n_draft()

        assert number_of_drafts == 0, number_of_drafts
コード例 #8
0
ファイル: test_cache_projects.py プロジェクト: ianthe/pybossa
    def test_n_draft_no_drafts(self):
        """Test CACHE PROJECTS _n_draft returns 0 if there are no draft projects"""
        # Here, we are suposing that a project is draft iff has no presenter AND has no tasks

        project = ProjectFactory.create(info={})
        TaskFactory.create_batch(2, project=project)

        number_of_drafts = cached_projects._n_draft()

        assert number_of_drafts == 0, number_of_drafts