Review fixes
This commit is contained in:
@@ -2,7 +2,6 @@ import os
|
||||
from lettuce import world
|
||||
from django.conf import settings
|
||||
|
||||
@world.absorb
|
||||
def import_file(filename):
|
||||
world.browser.execute_script("$('input.file-input').css('display', 'block')")
|
||||
path = os.path.join(settings.COMMON_TEST_DATA_ROOT, "imports", filename)
|
||||
@@ -14,7 +13,6 @@ def import_file(filename):
|
||||
world.css_click(outline_css)
|
||||
|
||||
|
||||
@world.absorb
|
||||
def go_to_import():
|
||||
menu_css = 'li.nav-course-tools'
|
||||
import_css = 'li.nav-course-tools-import a'
|
||||
@@ -95,7 +95,7 @@ Feature: CMS.Problem Editor
|
||||
And I go to the import page
|
||||
And I import the file "get_html_exception_test.tar.gz"
|
||||
When I go to the unit "Probability and BMI"
|
||||
And I click on the link "edit a draft"
|
||||
And I click on "edit a draft"
|
||||
Then I see a message that says "We're having trouble rendering your component"
|
||||
And I can edit the problem
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import json
|
||||
from lettuce import world, step
|
||||
from nose.tools import assert_equal, assert_true # pylint: disable=E0611
|
||||
from common import type_in_codemirror, open_new_course
|
||||
from course_import import import_file, go_to_import
|
||||
|
||||
|
||||
DISPLAY_NAME = "Display Name"
|
||||
@@ -206,17 +207,17 @@ def i_have_empty_course(step):
|
||||
|
||||
@step(u'I go to the import page')
|
||||
def i_go_to_import(_step):
|
||||
world.go_to_import()
|
||||
go_to_import()
|
||||
|
||||
|
||||
@step(u'I import the file "([^"]*)"$')
|
||||
def i_import_the_file(_step, filename):
|
||||
world.import_file(filename)
|
||||
import_file(filename)
|
||||
|
||||
|
||||
@step(u'I click on the link "([^"]*)"$')
|
||||
def i_click_on(_step, link):
|
||||
world.browser.click_link_by_text(link)
|
||||
@step(u'I click on "edit a draft"$')
|
||||
def i_edit_a_draft(_step):
|
||||
world.css_click("a.create-draft")
|
||||
|
||||
|
||||
@step(u'I go to the vertical "([^"]*)"$')
|
||||
@@ -233,7 +234,7 @@ def i_go_to_unit(_step, unit):
|
||||
@step(u'I see a message that says "([^"]*)"$')
|
||||
def i_can_see_message(_step, msg):
|
||||
msg = json.dumps(msg) # escape quotes
|
||||
world.browser.is_text_present(msg)
|
||||
world.css_has_text("h2.title", msg)
|
||||
|
||||
|
||||
@step(u'I can edit the problem$')
|
||||
|
||||
@@ -35,8 +35,6 @@ from .access import get_location_and_verify_access
|
||||
from util.json_request import JsonResponse
|
||||
from extract_tar import safetar_extractall
|
||||
|
||||
import traceback
|
||||
|
||||
|
||||
__all__ = ['import_course', 'import_status', 'generate_export_course', 'export_course']
|
||||
|
||||
@@ -230,7 +228,7 @@ def import_course(request, org, course, name):
|
||||
except Exception as exception: # pylint: disable=W0703
|
||||
return JsonResponse(
|
||||
{
|
||||
'ErrMsg': str(exception) + traceback.format_exc(),
|
||||
'ErrMsg': str(exception),
|
||||
'Stage': session_status[key]
|
||||
},
|
||||
status=400
|
||||
|
||||
Reference in New Issue
Block a user