Commit d9ba4103 by Julian Arni

Review fixes

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