예제 #1
0
 def test_get_lists_by_board_id(self):
     bid0 = Board.add("board1", "A")
     bid1 = Board.add("board2", "A")
     lid0 = List.add("List0", bid0)
     list0 = List.get(lid0)
     lid1 = List.add("List1", bid1)
     list1 = List.get(lid1)
     assert lid0 in [_list.id for _list in List.get_lists_by_board_id(bid0)]
     assert lid1 not in [_list.id for _list in List.get_lists_by_board_id(bid0)]
예제 #2
0
    def test_get_cards(self):
        bid0 = Board.add("board1", "A")
        lid0 = List.add("List0", bid0) 
        list0 = List.get(lid0)
        lid1 = List.add("List1", bid0) 
        list1 = List.get(lid1)

        uid0 = User.add("test1", "password", "*****@*****.**")
        
        caid0 = Card.add("card1", lid0, uid0)
        caid1 = Card.add("card2", lid1, uid0)

        assert caid0 in [card.id for card in list0.get_cards()]
        assert caid1 not in [card.id for card in list0.get_cards()]
예제 #3
0
def api_get_card(card_id = None):
    if card_id == None:
        return jsonify({'code': 400, 'message': 'Bad Request'})
    else:
        card = Card.get(long(card_id))
        if card == None:
            return jsonify({'code': 404, 'message': 'Page Not Found'})
        _list = List.get(card.list_id)
        return render_template('card.html',
                                card=card,
                                list=_list,
                                edit_card_desc_form=EditCardDescForm(),
                                add_comment_form=AddCommentForm());
예제 #4
0
 def test_set_and_get_list(self):
     bid0 = Board.add("board1", "A")
     lid0 = List.add("List0", bid0)
     list0 = List.get(lid0)
     assert list0.title == "List0", True
     assert list0.board_id == lid0