Commit dbf2cdc0 by Dean Dieker

Merge branch 'mchang/acceptance-testing' of https://github.com/MITx/mitx into…

Merge branch 'mchang/acceptance-testing' of https://github.com/MITx/mitx into mchang/acceptance-testing
parents 7441e7f0 ceef0038
...@@ -26,6 +26,7 @@ from courseware.access import has_access ...@@ -26,6 +26,7 @@ from courseware.access import has_access
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from courseware.courses import course_image_url, get_course_about_section, get_course_by_id from courseware.courses import course_image_url, get_course_about_section, get_course_by_id
import xmodule
## support functions ## support functions
def get_courses(): def get_courses():
...@@ -71,22 +72,58 @@ def get_courseware_with_tabs(course_id): ...@@ -71,22 +72,58 @@ def get_courseware_with_tabs(course_id):
the tabs on the right hand main navigation page. the tabs on the right hand main navigation page.
Example: Example:
[
{'chapter_name': 'Overview', [{
'sections': ['Welcome', 'System Usage Sequence', 'Lab0: Using the tools', 'Circuit Sandbox'] 'chapter_name': 'Overview',
}, 'sections': [{
{'chapter_name': 'Week 1', 'clickable_tab_count': 0,
'sections': ['Administrivia and Circuit Elements', 'Basic Circuit Analysis', 'Resistor Divider', 'Week 1 Tutorials'] 'section_name': 'Welcome',
}, 'tab_classes': []
{'chapter_name': 'Midterm Exam', }, {
'sections': ['Midterm Exam'] 'clickable_tab_count': 1,
} 'section_name': 'System Usage Sequence',
] 'tab_classes': ['VerticalDescriptor']
}, {
'clickable_tab_count': 0,
'section_name': 'Lab0: Using the tools',
'tab_classes': ['HtmlDescriptor', 'HtmlDescriptor', 'CapaDescriptor']
}, {
'clickable_tab_count': 0,
'section_name': 'Circuit Sandbox',
'tab_classes': []
}]
}, {
'chapter_name': 'Week 1',
'sections': [{
'clickable_tab_count': 4,
'section_name': 'Administrivia and Circuit Elements',
'tab_classes': ['VerticalDescriptor', 'VerticalDescriptor', 'VerticalDescriptor', 'VerticalDescriptor']
}, {
'clickable_tab_count': 0,
'section_name': 'Basic Circuit Analysis',
'tab_classes': ['CapaDescriptor', 'CapaDescriptor', 'CapaDescriptor']
}, {
'clickable_tab_count': 0,
'section_name': 'Resistor Divider',
'tab_classes': []
}, {
'clickable_tab_count': 0,
'section_name': 'Week 1 Tutorials',
'tab_classes': []
}]
}, {
'chapter_name': 'Midterm Exam',
'sections': [{
'clickable_tab_count': 2,
'section_name': 'Midterm Exam',
'tab_classes': ['VerticalDescriptor', 'VerticalDescriptor']
}]
}]
""" """
course = get_course_by_id(course_id) course = get_course_by_id(course_id)
chapters = course.get_children() chapters = course.get_children()
courseware = [ {'chapter_name':c.display_name, 'sections':[s.display_name for s in c.get_children()]} for c in chapters] courseware = [{'chapter_name':c.display_name, 'sections':[{'section_name':s.display_name, 'clickable_tab_count': len(s.get_children()) if (type(s)==xmodule.seq_module.SequenceDescriptor) else 0, 'tab_classes':[t.__class__.__name__ for t in s.get_children() ]} for s in c.get_children()]} for c in chapters ]
return courseware return courseware
## course listing step ## course listing step
......
...@@ -6,10 +6,6 @@ from os import getenv ...@@ -6,10 +6,6 @@ from os import getenv
@before.all @before.all
def setup_browser(): def setup_browser():
world.browser = webdriver.Firefox() world.browser = webdriver.Firefox()
world.dev_url = getenv("EDX_DEV_URL")
world.sandbox_url = getenv("EDX_SANDBOX_URL")
world.stage_url = getenv("EDX_STAGE_URL")
world.production_url = getenv("EDX_PRODUCTION_URL")
@after.all @after.all
def teardown_browser(total): def teardown_browser(total):
......
...@@ -97,27 +97,27 @@ OPENID_USE_AS_ADMIN_LOGIN = False ...@@ -97,27 +97,27 @@ OPENID_USE_AS_ADMIN_LOGIN = False
MITX_FEATURES['AUTH_USE_MIT_CERTIFICATES'] = True MITX_FEATURES['AUTH_USE_MIT_CERTIFICATES'] = True
################################ DEBUG TOOLBAR ################################# ################################ DEBUG TOOLBAR #################################
INSTALLED_APPS += ('debug_toolbar',) # INSTALLED_APPS += ('debug_toolbar',)
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',) # MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
INTERNAL_IPS = ('127.0.0.1',) # INTERNAL_IPS = ('127.0.0.1',)
DEBUG_TOOLBAR_PANELS = ( # DEBUG_TOOLBAR_PANELS = (
'debug_toolbar.panels.version.VersionDebugPanel', # 'debug_toolbar.panels.version.VersionDebugPanel',
'debug_toolbar.panels.timer.TimerDebugPanel', # 'debug_toolbar.panels.timer.TimerDebugPanel',
'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel', # 'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
'debug_toolbar.panels.headers.HeaderDebugPanel', # 'debug_toolbar.panels.headers.HeaderDebugPanel',
'debug_toolbar.panels.request_vars.RequestVarsDebugPanel', # 'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
'debug_toolbar.panels.sql.SQLDebugPanel', # 'debug_toolbar.panels.sql.SQLDebugPanel',
'debug_toolbar.panels.signals.SignalDebugPanel', # 'debug_toolbar.panels.signals.SignalDebugPanel',
'debug_toolbar.panels.logger.LoggingPanel', # 'debug_toolbar.panels.logger.LoggingPanel',
# Enabling the profiler has a weird bug as of django-debug-toolbar==0.9.4 and # Enabling the profiler has a weird bug as of django-debug-toolbar==0.9.4 and
# Django=1.3.1/1.4 where requests to views get duplicated (your method gets # Django=1.3.1/1.4 where requests to views get duplicated (your method gets
# hit twice). So you can uncomment when you need to diagnose performance # hit twice). So you can uncomment when you need to diagnose performance
# problems, but you shouldn't leave it on. # problems, but you shouldn't leave it on.
# 'debug_toolbar.panels.profiling.ProfilingDebugPanel', # 'debug_toolbar.panels.profiling.ProfilingDebugPanel',
) # )
############################ FILE UPLOADS (ASKBOT) ############################# ############################ FILE UPLOADS (ASKBOT) #############################
DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment