Exemplo n.º 1
0
 def setUpTestData(cls):
     """ Setup initial data:
     Create front page
     Create basic page
     Create menu
     Create blocks
     Create media
     :return: None
     """
     cls.node_rev_front = create_front('/')
     cls.node_rev_basic = create_basic('about')
     cls.menu = create_menu()
     # block system model tests
     cls.block_static = create_block_static(
         cls.node_rev_front.node.page_type, cls.node_rev_basic.node)
     cls.block_menu = create_block_menu(cls.node_rev_front.node.page_type,
                                        cls.menu)
     cls.block_terms = create_block_signal_terms(
         cls.node_rev_front.node.page_type)
     cls.block_generic = create_block_simple(
         cls.node_rev_front.node.page_type, 'generic')
     # block system view tests
     for i in range(1, 5):
         node_revision_basic = create_basic('block/' + str(i),
                                            settings.LANGUAGE_CODE,
                                            'About ' + str(i))
         if i == 4:  # disable for last one
             node_revision_basic.node.status = 0
             node_revision_basic.node.save()
         create_block_static(cls.node_rev_front.node.page_type,
                             node_revision_basic.node)
         create_page('video', "Video page", '', '', 'Video ' + str(i))
     create_block_simple(cls.node_rev_front.node.page_type, 'language')
     # Media system
     cls.img = create_image()
     cls.img_big = create_image('test_big.jpg')
     cls.img_big_portrait = create_image('test_big_portrait.jpg')
     cls.file = create_file()
     cls.video = create_video()
     # Taxonomy, Contact
     cls.term = create_terms(())
     cls.block_contact = create_block_simple(
         cls.node_rev_front.node.page_type, 'contact')
     # Extra model tests
     cls.node_rev_basic_no_alias = create_basic('')
     # login / user menu
     cls.block_login = create_block_simple(
         cls.node_rev_front.node.page_type, 'login')
     cls.block_user_menu = create_block_simple(
         cls.node_rev_front.node.page_type, 'user-menu')
     # search
     cls.block_search = create_block_simple(
         cls.node_rev_front.node.page_type, 'search')
     cls.node_rev_basic_search = create_basic('search')
     cls.block_search_results = create_block_simple(
         cls.node_rev_basic_search.node.page_type, 'search-results')
Exemplo n.º 2
0
 def setUpTestData(cls):
     """ Setup initial data:
     Create front page
     Create basic page
     Create user
     Create image
     :return: None
     """
     cls.node_rev_front = create_front('/')
     cls.node_rev_basic = create_basic('about')
     cls.admin = create_user()
     cls.simple_group = Group.objects.create(name='editor')
     cls.img = create_image()
     cls.block_login = create_block_simple(cls.node_rev_front.node.page_type, 'login')
     cls.block_user_menu = create_block_simple(cls.node_rev_front.node.page_type, 'user-menu')
     # add a second user menu element in same page type
     PageLayoutElement(
         page_type=cls.node_rev_front.node.page_type,
         region='footer',
         block=cls.block_user_menu,
         weight=0).save()
Exemplo n.º 3
0
 def setUpTestData(cls):
     """ Setup initial data:
     Create front page
     Create basic page
     Create menu
     Create blocks
     Create media
     :return: None
     """
     cls.node_rev_front = create_front('/')
     cls.node_rev_basic = create_basic('about')
     cls.menu = create_menu()
     # block system model tests
     cls.block_static = create_block_static(cls.node_rev_front.node.page_type, cls.node_rev_basic.node)
     cls.block_menu = create_block_menu(cls.node_rev_front.node.page_type, cls.menu)
     cls.block_terms = create_block_signal_terms(cls.node_rev_front.node.page_type)
     cls.block_generic = create_block_simple(cls.node_rev_front.node.page_type, 'generic')
     # block system view tests
     for i in range(1, 5):
         node_revision_basic = create_basic('block/' + str(i), settings.LANGUAGE_CODE, 'About ' + str(i))
         if i == 4:  # disable for last one
             node_revision_basic.node.status = 0
             node_revision_basic.node.save()
         create_block_static(cls.node_rev_front.node.page_type, node_revision_basic.node)
         create_page('video', "Video page", '', '', 'Video ' + str(i))
     create_block_simple(cls.node_rev_front.node.page_type, 'language')
     # Media system
     cls.img = create_image()
     cls.img_big = create_image('test_big.jpg')
     cls.img_big_portrait = create_image('test_big_portrait.jpg')
     cls.file = create_file()
     cls.video = create_video()
     # Taxonomy, Contact
     cls.term = create_terms(())
     cls.block_contact = create_block_simple(cls.node_rev_front.node.page_type, 'contact')
     # Extra model tests
     cls.node_rev_basic_no_alias = create_basic('')
     # login / user menu
     cls.block_login = create_block_simple(cls.node_rev_front.node.page_type, 'login')
     cls.block_user_menu = create_block_simple(cls.node_rev_front.node.page_type, 'user-menu')
     # search
     cls.block_search = create_block_simple(cls.node_rev_front.node.page_type, 'search')
     cls.node_rev_basic_search = create_basic('search')
     cls.block_search_results = create_block_simple(cls.node_rev_basic_search.node.page_type, 'search-results')