Skip to content

Instantly share code, notes, and snippets.

@singingwolfboy
Last active January 3, 2016 09:29
Show Gist options
  • Save singingwolfboy/8442963 to your computer and use it in GitHub Desktop.
Save singingwolfboy/8442963 to your computer and use it in GitHub Desktop.
% rake "test_lms[lms/djangoapps/courseware/tests/test_about.py]"
git clean -fqdx test_root/logs test_root/data test_root/staticfiles test_root/uploads
find . -type f -name *.pyc -delete
Node requirements unchanged, nothing to install
Ruby requirements unchanged, nothing to install
Python requirements unchanged, nothing to install
xmodule_assets common/static/xmodule
./manage.py lms --settings test preprocess_assets --traceback
node_modules/.bin/coffee --compile `find lms/ cms/ common/ -type f -name *.coffee`
sass --style compressed --cache-location /tmp/sass-cache --load-path ./common/static/sass --update -E utf-8 */static
overwrite lms/static/sass/application-extend1.css
overwrite lms/static/sass/application-extend2.css
overwrite lms/static/sass/application.css
overwrite lms/static/sass/course.css
./manage.py lms --settings test collectstatic --traceback --noinput > /dev/null
find /Users/db/dev/edx-platform/reports -type f -delete
python -m coverage run --rcfile=lms/.coveragerc `which ./manage.py` lms --settings test test --traceback lms/djangoapps/courseware/tests/test_about.py
nosetests --verbosity 1 lms/djangoapps/courseware/tests/test_about.py --id-file /Users/db/dev/edx-platform/.testids/lms/noseids --xunit-file /Users/db/dev/edx-platform/reports/lms/nosetests.xml
Creating test database for alias 'default'...
X
-----------------------------------------------------------------------------
1) ERROR: test_logged_in (courseware.tests.test_about.AboutTestCase)
Traceback (most recent call last):
lms/djangoapps/courseware/tests/test_about.py line 22 in setUp
org='org', number='num', display_name='name'
/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/factory/base.py line 514 in create
attrs = cls.attributes(create=True, extra=kwargs)
/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/factory/base.py line 363 in attributes
force_sequence=force_sequence,
/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/factory/containers.py line 282 in build
return stub.__fill__()
/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/factory/containers.py line 83 in __fill__
res[attr] = getattr(self, attr)
/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/factory/containers.py line 105 in __getattr__
val = val.evaluate(self, self.__containers)
/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/factory/containers.py line 214 in evaluate
containers=containers,
/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/factory/declarations.py line 75 in evaluate
return self.function(obj)
common/lib/xmodule/xmodule/modulestore/tests/factories.py line 32 in modulestore
return editable_modulestore('direct')
common/lib/xmodule/xmodule/modulestore/django.py line 171 in editable_modulestore
store = modulestore(name)
common/lib/xmodule/xmodule/modulestore/django.py line 112 in modulestore
settings.MODULESTORE[name]['ENGINE'],
KeyError: 'direct'
-------------------- >> begin captured logging << --------------------
xmodule.modulestore.xml: DEBUG: ========> Starting course import from conditional
xmodule.modulestore.xml: DEBUG: ========> Done with course import from conditional
xmodule.modulestore.xml: DEBUG: ========> Starting course import from conditional_and_poll
xmodule.modulestore.xml: WARNING: Error loading from xml. 'list' object has no attribute 'url'
xmodule.modulestore.xml: DEBUG: ========> Done with course import from conditional_and_poll
xmodule.modulestore.xml: DEBUG: ========> Starting course import from embedded_python
xmodule.modulestore.xml: DEBUG: ========> Done with course import from embedded_python
xmodule.modulestore.xml: DEBUG: ========> Starting course import from graded
xmodule.course_module: DEBUG: Loading grading policy from grading_policy.json
xmodule.modulestore.xml: DEBUG: ========> Done with course import from graded
xmodule.modulestore.xml: DEBUG: ========> Starting course import from graphic_slider_tool
xmodule.modulestore.xml: DEBUG: ========> Done with course import from graphic_slider_tool
xmodule.modulestore.xml: DEBUG: ========> Starting course import from import_draft_order
xmodule.course_module: DEBUG: Loading grading policy from policies/import_draft_order/grading_policy.json
xmodule.modulestore.xml: DEBUG: ========> Done with course import from import_draft_order
xmodule.modulestore.xml: DEBUG: ========> Starting course import from open_ended
xmodule.modulestore.xml: DEBUG: ========> Done with course import from open_ended
xmodule.modulestore.xml: DEBUG: ========> Starting course import from open_ended_nopath
xmodule.modulestore.xml: WARNING: Error loading from xml. Unable to load file contents at path chapter/Overview.xml for item i4x://edX/open_ended_nopath/chapter/Overview: Resource not found: /chapter/Overview.xml
xmodule.modulestore.xml: DEBUG: ========> Done with course import from open_ended_nopath
xmodule.modulestore.xml: DEBUG: ========> Starting course import from self_assessment
xmodule.modulestore.xml: DEBUG: ========> Done with course import from self_assessment
xmodule.modulestore.xml: DEBUG: ========> Starting course import from simple
xmodule.modulestore.xml: DEBUG: ========> Done with course import from simple
xmodule.modulestore.xml: DEBUG: ========> Starting course import from simple_with_draft
xmodule.modulestore.xml: DEBUG: ========> Done with course import from simple_with_draft
xmodule.modulestore.xml: DEBUG: ========> Starting course import from test_about_blob_end_date
xmodule.modulestore.xml: DEBUG: ========> Done with course import from test_about_blob_end_date
xmodule.modulestore.xml: DEBUG: ========> Starting course import from test_end
xmodule.modulestore.xml: DEBUG: ========> Done with course import from test_end
xmodule.modulestore.xml: DEBUG: ========> Starting course import from test_exam_registration
xmodule.modulestore.xml: WARNING: ERROR: loading course policy from /Users/db/dev/edx-platform/common/test/data/test_exam_registration/policies/2012_Fall.json Expecting property name: line 6 column 5 (char 170)
xmodule.modulestore.xml: DEBUG: ========> Done with course import from test_exam_registration
xmodule.modulestore.xml: DEBUG: ========> Starting course import from test_import_course
xmodule.modulestore.xml: WARNING: Error loading from xml. Unable to load file contents at path html/secret/toylab.xml for item i4x://edX/test_import_course/html/secret:toylab: Resource not found: /html/secret/toylab.xml
xmodule.modulestore.xml: WARNING: Error loading from xml. Unable to load file contents at path html/toyjumpto.xml for item i4x://edX/test_import_course/html/toyjumpto: Resource not found: /html/toyjumpto.xml
xmodule.modulestore.xml: WARNING: Error loading from xml. Unable to load file contents at path html/toyhtml.xml for item i4x://edX/test_import_course/html/toyhtml: Resource not found: /html/toyhtml.xml
xmodule.modulestore.xml: WARNING: Error loading from xml. Unable to load file contents at path html/nonportable.xml for item i4x://edX/test_import_course/html/nonportable: Resource not found: /html/nonportable.xml
xmodule.modulestore.xml: WARNING: Error loading from xml. Unable to load file contents at path html/nonportable_link.xml for item i4x://edX/test_import_course/html/nonportable_link: Resource not found: /html/nonportable_link.xml
xmodule.modulestore.xml: WARNING: Error loading from xml. Unable to load file contents at path chapter/secret/magic.xml for item i4x://edX/test_import_course/chapter/secret:magic: Resource not found: /chapter/secret/magic.xml
xmodule.modulestore.xml: WARNING: Error loading from xml. Unable to load file contents at path chapter/poll_test.xml for item i4x://edX/test_import_course/chapter/poll_test: Resource not found: /chapter/poll_test.xml
xmodule.modulestore.xml: WARNING: Error loading from xml. Unable to load file contents at path chapter/handout_container.xml for item i4x://edX/test_import_course/chapter/handout_container: Resource not found: /chapter/handout_container.xml
xmodule.modulestore.xml: DEBUG: ========> Done with course import from test_import_course
xmodule.modulestore.xml: DEBUG: ========> Starting course import from test_start_date
xmodule.modulestore.xml: DEBUG: ========> Done with course import from test_start_date
xmodule.modulestore.xml: DEBUG: ========> Starting course import from test_unicode
xmodule.modulestore.xml: WARNING: Error loading from xml. Invalid characters in u's\xeemple_\u221aideo'.
xmodule.modulestore.xml: WARNING: Error loading from xml. Unable to load file contents at path chapter/vertical_container.xml for item i4x://edX/test_unicode/chapter/vertical_container: Resource not found: /chapter/vertical_container.xml
root: ERROR: Failed to load /Users/db/dev/edx-platform/common/test/data/test_unicode/tabs/®esources.html. Skipping... Exception: Invalid characters in u'\xaeesources'.
Traceback (most recent call last):
File "/Users/db/dev/edx-platform/common/lib/xmodule/xmodule/modulestore/xml.py", line 573, in _load_extra_content
loc = course_descriptor.scope_ids.usage_id._replace(category=category, name=slug)
File "/Users/db/dev/edx-platform/common/lib/xmodule/xmodule/modulestore/__init__.py", line 268, in _replace
_check_location_part(value, INVALID_CHARS_NAME)
File "/Users/db/dev/edx-platform/common/lib/xmodule/xmodule/modulestore/__init__.py", line 55, in _check_location_part
raise InvalidLocationError("Invalid characters in {!r}.".format(val))
InvalidLocationError: Invalid characters in u'\xaeesources'.
xmodule.modulestore.xml: DEBUG: ========> Done with course import from test_unicode
xmodule.modulestore.xml: DEBUG: ========> Starting course import from toy
xmodule.modulestore.xml: DEBUG: ========> Done with course import from toy
xmodule.modulestore.xml: DEBUG: ========> Starting course import from two_toys
xmodule.course_module: DEBUG: Loading grading policy from policies/TT_2012_Fall/grading_policy.json
xmodule.modulestore.xml: DEBUG: ========> Done with course import from two_toys
xmodule.modulestore.xml: DEBUG: ========> Starting course import from word_cloud
xmodule.modulestore.xml: DEBUG: ========> Done with course import from word_cloud
root: DEBUG: Using MongoDB for static content serving at host=localhost db=xcontent
factory.generate: DEBUG: BaseFactory: Preparing xmodule.modulestore.tests.factories.CourseFactory(extra={'org': 'org', 'display_name': 'name', 'number': 'num'})
factory.generate: DEBUG: <class 'xmodule.modulestore.tests.factories.CourseFactory'>: reusing sequence from <class 'xmodule.modulestore.tests.factories.XModuleFactory'>
factory.generate: DEBUG: <class 'xmodule.modulestore.tests.factories.XModuleFactory'>: Setting up next sequence (0)
factory.containers: DEBUG: LazyStub: Computing values for xmodule.modulestore.tests.factories.CourseFactory(modulestore=<OrderedDeclarationWrapper for <factory.declarations.LazyAttribute object at 0x10db5ae50>>, org='org', display_name='name', number='num')
factory.generate: DEBUG: LazyAttribute: Evaluating <function modulestore at 0x10db63398> on <LazyStub for xmodule.modulestore.tests.factories.CourseFactory>
--------------------- >> end captured logging << ---------------------
-----------------------------------------------------------------------------
1 test run in 2.8 seconds.
1 error (0 tests passed)
rake aborted!
1 tests failed!
/Users/db/dev/edx-platform/rakelib/helpers.rb:143:in `block in <top (required)>'
Tasks: TOP => fail_tests
(See full trace by running task with --trace)
from django.core.urlresolvers import reverse
from .helpers import LoginEnrollmentTestCase
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
class AboutTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
def setUp(self):
self.course = CourseFactory.create(
org='org', number='num', display_name='name'
)
self.about = ItemFactory.create(
category="about", location=self.course.location
)
def test_logged_in(self):
self.setup_user()
url = reverse('about_course', args=[self.course.id])
resp = self.client.get(url)
import nose.tools; nose.tools.set_trace()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment