def test_current_card(self): from mnemosyne.libmnemosyne.statistics_pages.current_card import CurrentCard page = CurrentCard(self.mnemosyne.component_manager) page.prepare_statistics(0) assert "No current card." in page.html card_type = self.card_type_with_id("2") fact_data = {"f": "f", "b": "b"} card_1, card_2 = self.controller().create_new_cards(fact_data, card_type, grade=-1, tag_names=["default"]) self.review_controller().show_new_question() assert self.database().card_count_for_fact_view\ (card_type.fact_views[0], active_only=True) == 1 page.prepare_statistics(0) assert "Unseen card, no statistics available yet." in page.html self.review_controller().grade_answer(1) page.prepare_statistics(0) assert "No current card." not in page.html assert "Unseen card, no statistics available yet." not in page.html
def test_current_card(self): from mnemosyne.libmnemosyne.statistics_pages.current_card import CurrentCard page = CurrentCard(self.mnemosyne.component_manager) page.prepare_statistics(0) assert "No current card." in page.html card_type = self.card_type_by_id("2") fact_data = {"q": "q", "a": "a"} card_1, card_2 = self.controller().create_new_cards(fact_data, card_type, grade=-1, tag_names=["default"]) self.review_controller().new_question() page.prepare_statistics(0) assert "Unseen card, no statistics available yet." in page.html self.review_controller().grade_answer(1) page.prepare_statistics(0) assert "No current card." not in page.html assert "Unseen card, no statistics available yet." not in page.html