Пример #1
0
    def test_create_a_new_page(self):
        self.register_model('dbPages', dbPages)

        form_data = dict(page_name='First page')
        status = dict()

        page = pages.insert_or_update_page(form_data, status)

        new_page = page.get()

        self.assertEqual(new_page.name, 'First page')
Пример #2
0
    def test_create_a_new_page_with_content(self):
        self.register_model('dbPages', dbPages)
        self.register_model('dbPageModules', dbPageModules)

        form_data = {'page_name': 'First page', 'content_module|MainHeading': 'Some title'}
        status = dict()

        page = pages.insert_or_update_page(form_data, status)

        new_page = page.get()

        self.assertEqual(new_page.name, 'First page')
        self.assertEqual(new_page.page_modules['MainHeading'], 'Some title')
Пример #3
0
 def dispatch_post(self, form):
     return insert_or_update_page(form, dict())