Exemplo n.º 1
0
 def test_outside_block(self):
     template = Template('''
         {% extends "base.html" %}
         {% load otree_tags %}
         {% block content %}Click the next button...{% endblock %}
         {% next_button %}
         ''')
     self.assertTrue(check_next_button(template))
Exemplo n.º 2
0
 def test_outside_block(self):
     template = Template(
         '''
         {% extends "base.html" %}
         {% load otree_tags %}
         {% block content %}Click the next button...{% endblock %}
         {% next_button %}
         ''')
     self.assertTrue(check_next_button(template))
Exemplo n.º 3
0
 def get_no_next_buttons_pages(self):
     '''
     Check that every page in every app has next_button.
     Also including the last page. Next button on last page is
     necessary to trigger an externalSubmit to the MTurk server.
     '''
     for app in self.session.config['app_sequence']:
         views_module = otree.common_internal.get_views_module(app)
         for page_class in views_module.page_sequence:
             page = page_class()
             if isinstance(page, Page):
                 path_template = page.get_template_names()
                 template = select_template(path_template)
                 if not check_next_button(template):
                     yield page
Exemplo n.º 4
0
 def get_no_next_buttons_pages(self):
     '''
     Check that every page in every app has next_button.
     Also including the last page. Next button on last page is
     necessary to trigger an externalSubmit to the MTurk server.
     '''
     for app in self.session.config['app_sequence']:
         views_module = otree.common_internal.get_views_module(app)
         for page_class in views_module.page_sequence:
             page = page_class()
             if isinstance(page, Page):
                 path_template = page.get_template_names()
                 template = select_template(path_template)
                 if not check_next_button(template):
                     yield page
Exemplo n.º 5
0
 def get_no_next_buttons_pages(self):
     '''
     Check that every page in every app has next_button.
     Also including the last page. Next button on last page is
     necessary to trigger an externalSubmit to the MTurk server.
     '''
     for app in self.session.config['app_sequence']:
         views_module = otree.common_internal.get_views_module(app)
         for page_class in views_module.page_sequence:
             page = page_class()
             if isinstance(page, Page):
                 path_template = page.get_template_names()
                 template = select_template(path_template)
                 # The returned ``template`` variable is only a wrapper
                 # around Django's internal ``Template`` object.
                 template_name = template.origin.name
                 template = template.template
                 if not check_next_button(template):
                     yield page, template_name
Exemplo n.º 6
0
 def get_no_next_buttons_pages(self):
     '''
     Check that every page in every app has next_button.
     Also including the last page. Next button on last page is
     necessary to trigger an externalSubmit to the MTurk server.
     '''
     for app in self.session.config['app_sequence']:
         views_module = otree.common_internal.get_views_module(app)
         for page_class in views_module.page_sequence:
             page = page_class()
             if isinstance(page, Page):
                 path_template = page.get_template_names()
                 template = select_template(path_template)
                 # The returned ``template`` variable is only a wrapper
                 # around Django's internal ``Template`` object.
                 template = template.template
                 if not check_next_button(template):
                     # can't use template.origin.name because it's not
                     # available when DEBUG is off. So use path_template
                     # instead
                     yield page, path_template
Exemplo n.º 7
0
 def get_no_next_buttons_pages(self):
     '''
     Check that every page in every app has next_button.
     Also including the last page. Next button on last page is
     necessary to trigger an externalSubmit to the MTurk server.
     '''
     missing_next_button_pages = []
     for app in self.session.config['app_sequence']:
         views_module = otree.common_internal.get_pages_module(app)
         for page_class in views_module.page_sequence:
             page = page_class()
             if isinstance(page, Page):
                 path_template = page.get_template_names()
                 template = select_template(path_template)
                 # The returned ``template`` variable is only a wrapper
                 # around Django's internal ``Template`` object.
                 template = template.template
                 if not check_next_button(template):
                     # can't use template.origin.name because it's not
                     # available when DEBUG is off. So use path_template
                     # instead
                     missing_next_button_pages.append((page, path_template))
     return missing_next_button_pages