def test_items_todo_returns_only_todo_items(): view_model = TodoListViewModel(test_list, "writer") result = list(view_model.items_todo) result.sort(key=cardComparator) assert len(result) == 2 assert result[0].id == '1' assert result[1].id == '2'
def index(): print('getting all cards!!!') full_list = get_all_cards() v_model = TodoListViewModel( board_utils.mapCardsToLocalRepresentation(full_list), current_user_role_if_login_enabled()) return render_template('index.html', v_model=v_model)
def test_items_done_returns_only_done_items(): view_model = TodoListViewModel(test_list, "writer") result = list(view_model.items_done) result.sort(key=cardComparator) assert len(result) == 3 assert result[0].id == '3' assert result[1].id == '5' assert result[2].id == '6'
def test_items_done_all_returns_five_if_more_than_five(): test_list_local = test_list.copy() for i in range(7, 11): test_list_local.append(generate_done_card_with_id(i)) view_model = TodoListViewModel(test_list_local, "writer") result = list(view_model.items_done_all) result.sort(key=cardComparatorId) assert len(result) == 5 assert result[0].id == '5' assert result[1].id == '7' assert result[2].id == '8' assert result[3].id == '9' assert result[4].id == '10'
def test_older_done_items_returns_items_completed_before_today(): view_model = TodoListViewModel(test_list, "writer") result = list(view_model.older_done_items) result.sort(key=cardComparator) assert len(result) == 2 assert result[0].id == '3'
def test_items_done_today_returns_items_completed_today(): view_model = TodoListViewModel(test_list, "writer") result = list(view_model.items_done_today) result.sort(key=cardComparator) assert len(result) == 1 assert result[0].id == '5'
def test_items_doing_returns_only_doing_items(): view_model = TodoListViewModel(test_list, "writer") result = list(view_model.items_doing) result.sort(key=cardComparator) assert len(result) == 1 assert result[0].id == '4'
def test_items_done_all_returns_all_if_less_than_five(): view_model = TodoListViewModel(test_list, "writer") result = list(view_model.items_done_all) result.sort(key=cardComparator) assert len(result) == 3
def test_items_returns_all(): view_model = TodoListViewModel(test_list, "writer") assert len(view_model.items) == 6