예제 #1
0
 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')
예제 #2
0
 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")
예제 #3
0
 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')
예제 #4
0
 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")
예제 #5
0
 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'))
예제 #6
0
 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')