def test_get_glossary_terms(self): page = self.english_search_page glossary_term = GlossaryTerm(name_en='Escrow', definition_en='Definition', portal_topic=page.portal_topic) glossary_term.save() terms = page.get_glossary_terms() self.assertEqual(next(terms).name('en'), 'Escrow')
def test_get_glossary_terms(self): page = self.english_search_page glossary_term = GlossaryTerm( name_en="Escrow", definition_en="Definition", portal_topic=page.portal_topic, ) glossary_term.save() terms = page.get_glossary_terms() self.assertEqual(next(terms).name("en"), "Escrow")
def test_portal_category_page_key_terms(self): page = self.english_search_page glossary_term = GlossaryTerm(name_en='Amortization', definition_en='Definition', portal_topic=page.portal_topic) glossary_term.save() url = "{}key-terms/".format(page.url) response = self.client.get(url) self.assertEqual(response.status_code, 200) self.assertContains(response, 'Amortization')
def test_portal_category_page_key_terms_spanish(self): page = self.spanish_search_page glossary_term = GlossaryTerm( name_en="Amortization", name_es="Amortización", definition_es="Definición", portal_topic=page.portal_topic, ) glossary_term.save() url = "{}palabras-claves/".format(page.url) response = self.client.get(url) self.assertEqual(response.status_code, 200) self.assertContains(response, "Amortización")
def test_answer_page_url_no_answer_page(self): glossary_term = GlossaryTerm(name_en='foo') glossary_term.save() self.assertIsNone(glossary_term.answer_page_url('es')) self.assertIsNone(glossary_term.answer_page_url()) self.assertIsNone(glossary_term.answer_page_url('en'))
def test_term(self): glossary_term = GlossaryTerm(name_en='cool', name_es='chévere') glossary_term.save() self.assertEqual(glossary_term.name('es'), 'chévere') self.assertEqual(glossary_term.name(), 'cool') self.assertEqual(glossary_term.name('en'), 'cool')