def test_unassigned_not_added(self): """ Test: Test that the unsassigned flag in the feed is respected. Expected result: Only the assigned cards in bot boards will be in the feed. """ #Create a feed with only assigned cards: feed = logic.create_feed(self.user, True, False, 15, TEST_BOARDS) cal = logic.create_calendar_from_feed(feed) #check that there are entries from both boards, but only assigned ones: self.assertEqual(len(cal.subcomponents), 2, "More cards then expected.") for comp in cal.subcomponents: self.assertFalse("na" in comp["SUMMARY"], "Not assigned card added to cal.")
def test_subset_of_boards(self): """ Test: Create a calendar from a subset of the boards the user has. Expected result: Only the requested boards will be in calendar. """ #Create a feed with only one of the boards: feed = logic.create_feed(self.user, False, False, 15, TEST_BOARDS[:1]) cal = logic.create_calendar_from_feed(feed) #check that there are entries from test board 1 but not test board 2: self.assertEqual(len(cal.subcomponents), 2, "More cards then expected.") for comp in cal.subcomponents: self.assertTrue(comp["SUMMARY"].startswith("tb1"), "Wrong test board cards added.") self.assertFalse("nd" in comp["SUMMARY"], "No due date card was added.")