Ejemplo n.º 1
0
	def test_get_cards(self):
		Card = Mock(rosetrellis.models.Card)
		Card.get_many = get_mock_coro('buncha cards')

		board_cards = 'board cards'
		self.tc.get_board_cards = get_mock_coro(board_cards)

		an_id = 'an id'
		board = yield from Board.get({'name': 'a name', 'id': an_id}, self.tc)

		with patch('rosetrellis.models.Card', Card):
			cards = yield from board.get_cards()

		Card.get_many.assert_called_with(board_cards, self.tc, inflate_children=True)
Ejemplo n.º 2
0
	def test_get_checklists(self):
		Checklist = Mock(rosetrellis.models.Checklist)
		Checklist.get_many = get_mock_coro('buncha Checklists')

		board_checklists = 'board Checklists'
		self.tc.get_board_checklists = get_mock_coro(board_checklists)

		an_id = 'an id'
		board = yield from Board.get({'name': 'a name', 'id': an_id}, self.tc)

		with patch('rosetrellis.models.Checklist', Checklist):
			checklists = yield from board.get_checklists()

		Checklist.get_many.assert_called_with(board_checklists, self.tc, inflate_children=True)
Ejemplo n.º 3
0
	def test_get_lists(self):
		Lists = Mock(rosetrellis.models.Lists)
		Lists.get_many = get_mock_coro('buncha lists')

		board_lists = 'board lists'
		self.tc.get_board_lists = get_mock_coro(board_lists)

		an_id = 'an id'
		board = yield from Board.get({'name': 'a name', 'id': an_id}, self.tc)

		with patch('rosetrellis.models.Lists', Lists):
			lists = yield from board.get_lists()

		Lists.get_many.assert_called_with(board_lists, self.tc, inflate_children=True)