Ejemplo n.º 1
0
 def setUpTestData(cls):
     """ Setup initial data:
     Create 2 front pages
     Create 2 basic pages
     :return: None
     """
     cls.second_lang = get_second_language()
     cls.node_rev_front_first = create_front('/', settings.LANGUAGE_CODE)
     cls.node_rev_front_sec = create_front('/', cls.second_lang)
     cls.node_rev_basic_first = create_basic('about',
                                             settings.LANGUAGE_CODE)
     cls.node_rev_basic_sec = create_basic('about', cls.second_lang)
     for i in range(0, 3):
         node_rev_basic_first = create_basic('block/' + str(i),
                                             settings.LANGUAGE_CODE,
                                             '1st lang ' + str(i))
         node_rev_basic_second = create_basic('block/' + str(i),
                                              cls.second_lang,
                                              '2nd lang ' + str(i))
         create_block_static(cls.node_rev_front_first.node.page_type,
                             node_rev_basic_first.node)
         # same page type for both
         create_block_static(cls.node_rev_front_first.node.page_type,
                             node_rev_basic_second.node)
     cls.menu_en = create_menu('en')
     cls.menu_el = create_menu('el')
     create_block_menu(cls.node_rev_front_first.node.page_type, cls.menu_en)
     create_block_menu(cls.node_rev_front_first.node.page_type, cls.menu_el)
Ejemplo n.º 2
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')
Ejemplo 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')
Ejemplo n.º 4
0
 def setUpTestData(cls):
     """ Setup initial data:
     Create 2 front pages
     Create 2 basic pages
     :return: None
     """
     cls.second_lang = get_second_language()
     cls.node_rev_front_first = create_front('/', settings.LANGUAGE_CODE)
     cls.node_rev_front_sec = create_front('/', cls.second_lang)
     cls.node_rev_basic_first = create_basic('about', settings.LANGUAGE_CODE)
     cls.node_rev_basic_sec = create_basic('about', cls.second_lang)
     for i in range(0, 3):
         node_rev_basic_first = create_basic('block/' + str(i), settings.LANGUAGE_CODE, '1st lang ' + str(i))
         node_rev_basic_second = create_basic('block/' + str(i), cls.second_lang, '2nd lang ' + str(i))
         create_block_static(cls.node_rev_front_first.node.page_type, node_rev_basic_first.node)
         # same page type for both
         create_block_static(cls.node_rev_front_first.node.page_type, node_rev_basic_second.node)
     cls.menu_en = create_menu('en')
     cls.menu_el = create_menu('el')
     create_block_menu(cls.node_rev_front_first.node.page_type, cls.menu_en)
     create_block_menu(cls.node_rev_front_first.node.page_type, cls.menu_el)