Пример #1
0
 def test_get_success_url(self):
     view = SubmitSnippetTranslationView()
     view.object = self.en_snippet
     view.kwargs = {
         "app_label": "some_app",
         "model_name": "some_model",
         "pk": 99,
     }
     self.assertEqual(view.get_success_url(),
                      "/admin/snippets/some_app/some_model/edit/99/")
Пример #2
0
    def test_get_success_url_for_single_locale(self):
        view = SubmitSnippetTranslationView()
        view.object = self.en_snippet
        view.kwargs = {
            "app_label": "snippetstests",
            "model_name": "translatablesnippet",
            "pk": 99,
        }

        self.assertEqual(
            view.get_success_url(view.object),
            reverse(
                "wagtailsnippets_snippetstests_translatablesnippet:edit",
                args=[view.object.pk],
            ),
        )