Exemple #1
0
 def test_get_context_data(self, **kwargs):
     view = SubmitTranslationView()
     view.request = self.factory.get("/path/does/not/matter/")
     view.object = self.en_homepage
     context = view.get_context_data()
     self.assertIn("form", context.keys())
     self.assertIsInstance(context["form"], SubmitTranslationForm)
Exemple #2
0
 def test_get_form(self):
     view = SubmitTranslationView()
     view.request = self.factory.get("/path/does/not/matter/")
     view.object = self.en_homepage
     form = view.get_form()
     self.assertIsInstance(form, SubmitTranslationForm)
Exemple #3
0
 def test_get_success_url(self):
     with self.assertRaises(NotImplementedError):
         view = SubmitTranslationView()
         view.object = self.en_homepage
         view.get_success_url()
Exemple #4
0
 def test_subtitle(self):
     view = SubmitTranslationView()
     view.object = self.en_homepage
     self.assertEqual(view.get_subtitle(), str(self.en_homepage))