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
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
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
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