Add basic tests for publication test
This commit is contained in:
Родитель
7a9d4fab95
Коммит
7c7c4971e7
|
@ -0,0 +1,19 @@
|
|||
import http
|
||||
|
||||
from networkapi.wagtailpages.factory import publication as publication_factory
|
||||
from networkapi.wagtailpages.tests import base as test_base
|
||||
|
||||
|
||||
class PublicationPageTests(test_base.WagtailpagesTestCase):
|
||||
def test_factory(self):
|
||||
publication_factory.PublicationPageFactory()
|
||||
|
||||
self.assertTrue(True)
|
||||
|
||||
def test_page_loads(self):
|
||||
publication_page = publication_factory.PublicationPageFactory(parent=self.homepage)
|
||||
|
||||
response = self.client.get(path=publication_page.get_url())
|
||||
|
||||
self.assertEqual(response.status_code, http.HTTPStatus.OK)
|
||||
self.assertContains(response, publication_page.title)
|
Загрузка…
Ссылка в новой задаче