Skip to content

Instantly share code, notes, and snippets.

@remitaffin
Created March 17, 2015 20:38
Show Gist options
  • Save remitaffin/5ac8c8c00bea9b79223b to your computer and use it in GitHub Desktop.
Save remitaffin/5ac8c8c00bea9b79223b to your computer and use it in GitHub Desktop.
jenkins@ip-10-136-64-207:~/jobs/run_noodleapi_tests/workspace/jenkins$ fig run -T noodleapi bash -c "sleep 2 && python /usr/local/lib/python2.7/dist-packages/pytest.py --ds=settings.test -n 3"
============================= test session starts ==============================
platform linux2 -- Python 2.7.3 -- py-1.4.26 -- pytest-2.6.4
plugins: xdist, django
gw0 I / gw1 I / gw2 I
gw0 [1010] / gw1 [1010] / gw2 [1010]
scheduling tests via LoadScheduling
....................................................................................................................................................................................................................................................................................................................................................................F.....F............................................F........F..F...............F....................................F...F...F.......F..F..FF..FF..FF....F..FF..........F.FF...FFFF...F....F..F.....F..F................F.....F........FFF.......FF...F.F........F.........................................................................................F..............................................................................................................................................................................F....................................................................................................................................
=================================== FAILURES ===================================
FunctionalCategorySearchTests.test_category_search_get_results_facets_law_facet_count_1000
[gw1] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.noodlesearch.search.tests.test_categorysearch.FunctionalCategorySearchTests testMethod=test_category_search_get_results_facets_law_facet_count_1000>
def setUp(self):
super(FunctionalCategorySearchTests, self).setUp()
create_users()
> load_profiles()
noodlesearch/search/tests/test_categorysearch.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
profiles/tests/data/profilecategory_data.py:226: in load
}, send_queue=False)
content/document.py:386: in create
category_code= document.get('n_key', nid.getCatCode(collection= document.get('entity_type')))[:2]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'NoodleID' object has no attribute 'getKey'") raised in repr()] SafeRepr object at 0x8863a70>
collection = 'college_institution', description = None
def getCatCode(self, collection= None, description= None):
"""
returns the category code for the given collection, description
"""
query= dict()
if collection != None:
query.update([('collection', collection)])
if description != None:
query.update([('description', description)])
obj= self.dbh.find_one(query)
if obj == None:
raise Exception('NOT FOUND: %s [%s:%s %s.%s]' %
> (str(query), self.host, self.port, self.schema, self.categories))
E Exception: NOT FOUND: {'collection': 'college_institution'} [mongo:27017 test_development.categories]
core/utils/general.py:341: Exception
______ FunctionalCategorySearchTests.test_get_gpa_boost_returns_expected _______
[gw1] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.noodlesearch.search.tests.test_categorysearch.FunctionalCategorySearchTests testMethod=test_get_gpa_boost_returns_expected>
def setUp(self):
super(FunctionalCategorySearchTests, self).setUp()
create_users()
> load_profiles()
noodlesearch/search/tests/test_categorysearch.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
profiles/tests/data/profilecategory_data.py:226: in load
}, send_queue=False)
content/document.py:386: in create
category_code= document.get('n_key', nid.getCatCode(collection= document.get('entity_type')))[:2]
core/utils/general.py:338: in getCatCode
obj= self.dbh.find_one(query)
/usr/local/lib/python2.7/dist-packages/pymongo/collection.py:596: in find_one
for result in self.find(spec_or_id, *args, **kwargs).limit(-1):
/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py:814: in next
if len(self.__data) or self._refresh():
/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py:763: in _refresh
self.__uuid_subtype))
/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py:720: in __send_message
self.__uuid_subtype)
/usr/local/lib/python2.7/dist-packages/pymongo/helpers.py:95: in _unpack_response
error_object = bson.BSON(response[20:]).decode()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = "\x9c\x00\x00\x00\x02$err\x00\x83\x00\x00\x00can't open database in a read loc...uery. might otherwise indicate an internal error\x00\x10code\x007>\x00\x00\x00"
as_class = <type 'dict'>, tz_aware = False, uuid_subtype = 3, compile_re = True
def decode(self, as_class=dict,
tz_aware=False, uuid_subtype=OLD_UUID_SUBTYPE, compile_re=True):
"""Decode this BSON data.
The default type to use for the resultant document is
:class:`dict`. Any other class that supports
:meth:`__setitem__` can be used instead by passing it as the
`as_class` parameter.
If `tz_aware` is ``True`` (recommended), any
:class:`~datetime.datetime` instances returned will be
timezone-aware, with their timezone set to
:attr:`bson.tz_util.utc`. Otherwise (default), all
:class:`~datetime.datetime` instances will be naive (but
contain UTC).
:Parameters:
- `as_class` (optional): the class to use for the resulting
document
- `tz_aware` (optional): if ``True``, return timezone-aware
:class:`~datetime.datetime` instances
- `compile_re` (optional): if ``False``, don't attempt to compile
BSON regular expressions into Python regular expressions. Return
instances of
:class:`~bson.regex.Regex` instead. Can avoid
:exc:`~bson.errors.InvalidBSON` errors when receiving
Python-incompatible regular expressions, for example from
``currentOp``
.. versionchanged:: 2.7
Added ``compile_re`` option.
.. versionadded:: 1.9
"""
(document, _) = _bson_to_dict(
> self, as_class, tz_aware, uuid_subtype, compile_re)
E TypeError: function takes exactly 4 arguments (5 given)
/usr/local/lib/python2.7/dist-packages/bson/__init__.py:624: TypeError
CollegeProfileTests.test_get_admission_contact_data_with_no_valid_information _
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_college.CollegeProfileTests testMethod=test_get_admission_contact_data_with_no_valid_information>
def setUp(self):
super(CollegeProfileTests, self).setUp()
load()
# Set a sample college profile to be used for the tests.
self.brown_college_profile = CollegeProfile.objects.get(
> nice_key='coN'
)
profiles/tests/models/test_college.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [<CollegeProfile: CollegeProfile object>], q_objs = ()
query = {'nice_key': 'coN'}, queryset = []
msg = 'CollegeProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: CollegeProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
_________________ CollegeProfileTests.test_get_popular_majors __________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_college.CollegeProfileTests testMethod=test_get_popular_majors>
def setUp(self):
super(CollegeProfileTests, self).setUp()
load()
# Set a sample college profile to be used for the tests.
self.brown_college_profile = CollegeProfile.objects.get(
nice_key='coN'
)
self.bare_college_profile_example = CollegeProfile.objects.get(
> nice_key='cojS8'
)
profiles/tests/models/test_college.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'cojS8'}, queryset = []
msg = 'CollegeProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: CollegeProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
____________________ CollegeProfileTests.test_get_rankings _____________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_college.CollegeProfileTests testMethod=test_get_rankings>
def setUp(self):
super(CollegeProfileTests, self).setUp()
load()
# Set a sample college profile to be used for the tests.
self.brown_college_profile = CollegeProfile.objects.get(
> nice_key='coN'
)
profiles/tests/models/test_college.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [<CollegeProfile: CollegeProfile object>], q_objs = ()
query = {'nice_key': 'coN'}, queryset = []
msg = 'CollegeProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: CollegeProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
_____________________ CourseProfileTests.test_provider_url _____________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_course.CourseProfileTests testMethod=test_provider_url>
def setUp(self):
super(CourseProfileTests, self).setUp()
load()
> self.skate_profile = OnlineCourseProfile.objects.get(nice_key='oc791d3')
profiles/tests/models/test_course.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[TypeError("function takes exactly 4 arguments (5 given)") raised in repr()] SafeRepr object at 0x94dde18>
q_objs = (), query = {'nice_key': 'oc791d3'}, queryset = []
msg = 'OnlineCourseProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: OnlineCourseProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
____________________ InternshipProfileTests.test_get_phone _____________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_internship.InternshipProfileTests testMethod=test_get_phone>
def setUp(self):
super(InternshipProfileTests, self).setUp()
load()
self.internship_profile = InternshipProfile.objects.get(
> nice_key=InternshipProfileTests.NICE_KEY
)
profiles/tests/models/test_internship.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'inc8166'}, queryset = []
msg = 'InternshipProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: InternshipProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
_____________________ InternshipProfileTests.test_get_url ______________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_internship.InternshipProfileTests testMethod=test_get_url>
def setUp(self):
super(InternshipProfileTests, self).setUp()
load()
self.internship_profile = InternshipProfile.objects.get(
> nice_key=InternshipProfileTests.NICE_KEY
)
profiles/tests/models/test_internship.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'inc8166'}, queryset = []
msg = 'InternshipProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: InternshipProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
_______________________ LawProfileTests.test_admissions ________________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_law.LawProfileTests testMethod=test_admissions>
def setUp(self):
super(LawProfileTests, self).setUp()
load()
# Set a sample school profile to be used for the tests.
self.hawaii_profile = LawProfile.objects.get(
> nice_key='gryTJ'
)
profiles/tests/models/test_law.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'gryTJ'}, queryset = []
msg = 'LawProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: LawProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
___________________ LawProfileTests.test_get_admission_data ____________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_law.LawProfileTests testMethod=test_get_admission_data>
def setUp(self):
super(LawProfileTests, self).setUp()
load()
# Set a sample school profile to be used for the tests.
self.hawaii_profile = LawProfile.objects.get(
> nice_key='gryTJ'
)
profiles/tests/models/test_law.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'gryTJ'}, queryset = []
msg = 'LawProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: LawProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
__________________ LawProfileTests.test_get_admission_metrics __________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_law.LawProfileTests testMethod=test_get_admission_metrics>
def setUp(self):
super(LawProfileTests, self).setUp()
load()
# Set a sample school profile to be used for the tests.
self.hawaii_profile = LawProfile.objects.get(
> nice_key='gryTJ'
)
profiles/tests/models/test_law.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'gryTJ'}, queryset = []
msg = 'LawProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: LawProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
__________ FunctionalProfilesTests.test_retrieve_profile_by_nice_key ___________
[gw1] linux2 -- Python 2.7.3 /usr/bin/python
args = (<noodleapi.profiles.tests.test_views.FunctionalProfilesTests testMethod=test_retrieve_profile_by_nice_key>,)
keywargs = {}, extra_args = []
entered_patchers = [<mock._patch object at 0x58f7e10>]
exc_info = (<type 'exceptions.AssertionError'>, AssertionError('301 != 200',), <traceback object at 0x97c7950>)
patching = <mock._patch object at 0x58f7e10>, arg = 1
@wraps(func)
def patched(*args, **keywargs):
# don't use a with here (backwards compatability with Python 2.4)
extra_args = []
entered_patchers = []
# can't use try...except...finally because of Python 2.4
# compatibility
exc_info = tuple()
try:
try:
for patching in patched.patchings:
arg = patching.__enter__()
entered_patchers.append(patching)
if patching.attribute_name is not None:
keywargs.update(arg)
elif patching.new is DEFAULT:
extra_args.append(arg)
args += tuple(extra_args)
> return func(*args, **keywargs)
/usr/local/lib/python2.7/dist-packages/mock.py:1201:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
profiles/tests/test_views.py:72: in test_retrieve_profile_by_nice_key
self.assertEqual(response.status_code, 200)
E AssertionError: 301 != 200
____________________ LawProfileTests.test_get_financial_aid ____________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_law.LawProfileTests testMethod=test_get_financial_aid>
def setUp(self):
super(LawProfileTests, self).setUp()
load()
# Set a sample school profile to be used for the tests.
self.hawaii_profile = LawProfile.objects.get(
> nice_key='gryTJ'
)
profiles/tests/models/test_law.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'gryTJ'}, queryset = []
msg = 'LawProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: LawProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
______ FunctionalProfilesTests.test_retrieve_profile_by_nice_key_redirect ______
[gw1] linux2 -- Python 2.7.3 /usr/bin/python
args = (<noodleapi.profiles.tests.test_views.FunctionalProfilesTests testMethod=test_retrieve_profile_by_nice_key_redirect>,)
keywargs = {}, extra_args = []
entered_patchers = [<mock._patch object at 0x590bc50>]
exc_info = (<type 'exceptions.TypeError'>, TypeError('function takes exactly 4 arguments (5 given)',), <traceback object at 0x90af908>)
patching = <mock._patch object at 0x590bc50>, arg = 1
@wraps(func)
def patched(*args, **keywargs):
# don't use a with here (backwards compatability with Python 2.4)
extra_args = []
entered_patchers = []
# can't use try...except...finally because of Python 2.4
# compatibility
exc_info = tuple()
try:
try:
for patching in patched.patchings:
arg = patching.__enter__()
entered_patchers.append(patching)
if patching.attribute_name is not None:
keywargs.update(arg)
elif patching.new is DEFAULT:
extra_args.append(arg)
args += tuple(extra_args)
> return func(*args, **keywargs)
/usr/local/lib/python2.7/dist-packages/mock.py:1201:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
profiles/tests/test_views.py:54: in test_retrieve_profile_by_nice_key_redirect
response = self.client.get(test_url)
/usr/local/lib/python2.7/dist-packages/django/test/client.py:473: in get
response = super(Client, self).get(path, data=data, **extra)
/usr/local/lib/python2.7/dist-packages/django/test/client.py:280: in get
return self.request(**r)
/usr/local/lib/python2.7/dist-packages/django/test/client.py:444: in request
six.reraise(*exc_info)
/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py:112: in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py:69: in view
return self.dispatch(request, *args, **kwargs)
/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py:87: in dispatch
return handler(request, *args, **kwargs)
profiles/views.py:118: in get
response = super(ProfileView, self).get(request, *args, **kwargs)
/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py:154: in get
context = self.get_context_data(**kwargs)
profiles/views.py:76: in get_context_data
context['profile'] = self.get_profile(nice_key)
profiles/views.py:144: in get_profile
return self.profile_model.objects.get(nice_key=nice_key)
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:182: in get
result = queryset.next()
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:1137: in next
raw_doc = self._cursor.next()
/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py:814: in next
if len(self.__data) or self._refresh():
/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py:763: in _refresh
self.__uuid_subtype))
/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py:720: in __send_message
self.__uuid_subtype)
/usr/local/lib/python2.7/dist-packages/pymongo/helpers.py:95: in _unpack_response
error_object = bson.BSON(response[20:]).decode()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = "\x9c\x00\x00\x00\x02$err\x00\x83\x00\x00\x00can't open database in a read loc...uery. might otherwise indicate an internal error\x00\x10code\x007>\x00\x00\x00"
as_class = <type 'dict'>, tz_aware = False, uuid_subtype = 3, compile_re = True
def decode(self, as_class=dict,
tz_aware=False, uuid_subtype=OLD_UUID_SUBTYPE, compile_re=True):
"""Decode this BSON data.
The default type to use for the resultant document is
:class:`dict`. Any other class that supports
:meth:`__setitem__` can be used instead by passing it as the
`as_class` parameter.
If `tz_aware` is ``True`` (recommended), any
:class:`~datetime.datetime` instances returned will be
timezone-aware, with their timezone set to
:attr:`bson.tz_util.utc`. Otherwise (default), all
:class:`~datetime.datetime` instances will be naive (but
contain UTC).
:Parameters:
- `as_class` (optional): the class to use for the resulting
document
- `tz_aware` (optional): if ``True``, return timezone-aware
:class:`~datetime.datetime` instances
- `compile_re` (optional): if ``False``, don't attempt to compile
BSON regular expressions into Python regular expressions. Return
instances of
:class:`~bson.regex.Regex` instead. Can avoid
:exc:`~bson.errors.InvalidBSON` errors when receiving
Python-incompatible regular expressions, for example from
``currentOp``
.. versionchanged:: 2.7
Added ``compile_re`` option.
.. versionadded:: 1.9
"""
(document, _) = _bson_to_dict(
> self, as_class, tz_aware, uuid_subtype, compile_re)
E TypeError: function takes exactly 4 arguments (5 given)
/usr/local/lib/python2.7/dist-packages/bson/__init__.py:624: TypeError
_______________________ LawProfileTests.test_get_tuition _______________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_law.LawProfileTests testMethod=test_get_tuition>
def setUp(self):
super(LawProfileTests, self).setUp()
load()
# Set a sample school profile to be used for the tests.
self.hawaii_profile = LawProfile.objects.get(
> nice_key='gryTJ'
)
profiles/tests/models/test_law.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:182: in get
result = queryset.next()
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:1137: in next
raw_doc = self._cursor.next()
/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py:814: in next
if len(self.__data) or self._refresh():
/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py:763: in _refresh
self.__uuid_subtype))
/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py:720: in __send_message
self.__uuid_subtype)
/usr/local/lib/python2.7/dist-packages/pymongo/helpers.py:95: in _unpack_response
error_object = bson.BSON(response[20:]).decode()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = "\x9c\x00\x00\x00\x02$err\x00\x83\x00\x00\x00can't open database in a read loc...uery. might otherwise indicate an internal error\x00\x10code\x007>\x00\x00\x00"
as_class = <type 'dict'>, tz_aware = False, uuid_subtype = 3, compile_re = True
def decode(self, as_class=dict,
tz_aware=False, uuid_subtype=OLD_UUID_SUBTYPE, compile_re=True):
"""Decode this BSON data.
The default type to use for the resultant document is
:class:`dict`. Any other class that supports
:meth:`__setitem__` can be used instead by passing it as the
`as_class` parameter.
If `tz_aware` is ``True`` (recommended), any
:class:`~datetime.datetime` instances returned will be
timezone-aware, with their timezone set to
:attr:`bson.tz_util.utc`. Otherwise (default), all
:class:`~datetime.datetime` instances will be naive (but
contain UTC).
:Parameters:
- `as_class` (optional): the class to use for the resulting
document
- `tz_aware` (optional): if ``True``, return timezone-aware
:class:`~datetime.datetime` instances
- `compile_re` (optional): if ``False``, don't attempt to compile
BSON regular expressions into Python regular expressions. Return
instances of
:class:`~bson.regex.Regex` instead. Can avoid
:exc:`~bson.errors.InvalidBSON` errors when receiving
Python-incompatible regular expressions, for example from
``currentOp``
.. versionchanged:: 2.7
Added ``compile_re`` option.
.. versionadded:: 1.9
"""
(document, _) = _bson_to_dict(
> self, as_class, tz_aware, uuid_subtype, compile_re)
E TypeError: function takes exactly 4 arguments (5 given)
/usr/local/lib/python2.7/dist-packages/bson/__init__.py:624: TypeError
______________ SummerCampProfileTests.test_is_aca_accredited_true ______________
[gw1] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_summer_camp.SummerCampProfileTests testMethod=test_is_aca_accredited_true>
def setUp(self):
super(SummerCampProfileTests, self).setUp()
load()
> self.bearskin_profile = SummerCampProfile.objects.get(nice_key='sca75e8')
profiles/tests/models/test_summer_camp.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:182: in get
result = queryset.next()
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:1137: in next
raw_doc = self._cursor.next()
/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py:814: in next
if len(self.__data) or self._refresh():
/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py:763: in _refresh
self.__uuid_subtype))
/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py:720: in __send_message
self.__uuid_subtype)
/usr/local/lib/python2.7/dist-packages/pymongo/helpers.py:95: in _unpack_response
error_object = bson.BSON(response[20:]).decode()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = "\x9c\x00\x00\x00\x02$err\x00\x83\x00\x00\x00can't open database in a read loc...uery. might otherwise indicate an internal error\x00\x10code\x007>\x00\x00\x00"
as_class = <type 'dict'>, tz_aware = False, uuid_subtype = 3, compile_re = True
def decode(self, as_class=dict,
tz_aware=False, uuid_subtype=OLD_UUID_SUBTYPE, compile_re=True):
"""Decode this BSON data.
The default type to use for the resultant document is
:class:`dict`. Any other class that supports
:meth:`__setitem__` can be used instead by passing it as the
`as_class` parameter.
If `tz_aware` is ``True`` (recommended), any
:class:`~datetime.datetime` instances returned will be
timezone-aware, with their timezone set to
:attr:`bson.tz_util.utc`. Otherwise (default), all
:class:`~datetime.datetime` instances will be naive (but
contain UTC).
:Parameters:
- `as_class` (optional): the class to use for the resulting
document
- `tz_aware` (optional): if ``True``, return timezone-aware
:class:`~datetime.datetime` instances
- `compile_re` (optional): if ``False``, don't attempt to compile
BSON regular expressions into Python regular expressions. Return
instances of
:class:`~bson.regex.Regex` instead. Can avoid
:exc:`~bson.errors.InvalidBSON` errors when receiving
Python-incompatible regular expressions, for example from
``currentOp``
.. versionchanged:: 2.7
Added ``compile_re`` option.
.. versionadded:: 1.9
"""
(document, _) = _bson_to_dict(
> self, as_class, tz_aware, uuid_subtype, compile_re)
E TypeError: function takes exactly 4 arguments (5 given)
/usr/local/lib/python2.7/dist-packages/bson/__init__.py:624: TypeError
______________________ LawProfileTests.test_get_whiskers _______________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_law.LawProfileTests testMethod=test_get_whiskers>
def setUp(self):
super(LawProfileTests, self).setUp()
load()
# Set a sample school profile to be used for the tests.
self.hawaii_profile = LawProfile.objects.get(
> nice_key='gryTJ'
)
profiles/tests/models/test_law.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:182: in get
result = queryset.next()
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:1137: in next
raw_doc = self._cursor.next()
/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py:814: in next
if len(self.__data) or self._refresh():
/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py:763: in _refresh
self.__uuid_subtype))
/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py:720: in __send_message
self.__uuid_subtype)
/usr/local/lib/python2.7/dist-packages/pymongo/helpers.py:95: in _unpack_response
error_object = bson.BSON(response[20:]).decode()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = "\x9c\x00\x00\x00\x02$err\x00\x83\x00\x00\x00can't open database in a read loc...uery. might otherwise indicate an internal error\x00\x10code\x007>\x00\x00\x00"
as_class = <type 'dict'>, tz_aware = False, uuid_subtype = 3, compile_re = True
def decode(self, as_class=dict,
tz_aware=False, uuid_subtype=OLD_UUID_SUBTYPE, compile_re=True):
"""Decode this BSON data.
The default type to use for the resultant document is
:class:`dict`. Any other class that supports
:meth:`__setitem__` can be used instead by passing it as the
`as_class` parameter.
If `tz_aware` is ``True`` (recommended), any
:class:`~datetime.datetime` instances returned will be
timezone-aware, with their timezone set to
:attr:`bson.tz_util.utc`. Otherwise (default), all
:class:`~datetime.datetime` instances will be naive (but
contain UTC).
:Parameters:
- `as_class` (optional): the class to use for the resulting
document
- `tz_aware` (optional): if ``True``, return timezone-aware
:class:`~datetime.datetime` instances
- `compile_re` (optional): if ``False``, don't attempt to compile
BSON regular expressions into Python regular expressions. Return
instances of
:class:`~bson.regex.Regex` instead. Can avoid
:exc:`~bson.errors.InvalidBSON` errors when receiving
Python-incompatible regular expressions, for example from
``currentOp``
.. versionchanged:: 2.7
Added ``compile_re`` option.
.. versionadded:: 1.9
"""
(document, _) = _bson_to_dict(
> self, as_class, tz_aware, uuid_subtype, compile_re)
E TypeError: function takes exactly 4 arguments (5 given)
/usr/local/lib/python2.7/dist-packages/bson/__init__.py:624: TypeError
______________________ SummerCampProfileTests.test_title _______________________
[gw1] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_summer_camp.SummerCampProfileTests testMethod=test_title>
def setUp(self):
super(SummerCampProfileTests, self).setUp()
load()
> self.bearskin_profile = SummerCampProfile.objects.get(nice_key='sca75e8')
profiles/tests/models/test_summer_camp.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'sca75e8'}, queryset = []
msg = 'SummerCampProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: SummerCampProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
_____________________ LawProfileTests.test_institution_ok ______________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_law.LawProfileTests testMethod=test_institution_ok>
def setUp(self):
super(LawProfileTests, self).setUp()
load()
# Set a sample school profile to be used for the tests.
self.hawaii_profile = LawProfile.objects.get(
> nice_key='gryTJ'
)
profiles/tests/models/test_law.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'gryTJ'}, queryset = []
msg = 'LawProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: LawProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
___________________ TutorProfileTests.test_get_display_phone ___________________
[gw1] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_tutor.TutorProfileTests testMethod=test_get_display_phone>
def test_get_display_phone(self):
"""
This function tests that the phone number from the data is correctly
formatted by our get_display_phone function
"""
> tutor = TutorProfile.objects.get(nice_key=TutorProfileTests.NICE_KEY)
profiles/tests/models/test_tutor.py:56:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'tufdbaf'}, queryset = []
msg = 'TutorProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: TutorProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
____________________ LawProfileTests.test_program_outcomes _____________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_law.LawProfileTests testMethod=test_program_outcomes>
def setUp(self):
super(LawProfileTests, self).setUp()
load()
# Set a sample school profile to be used for the tests.
self.hawaii_profile = LawProfile.objects.get(
> nice_key='gryTJ'
)
profiles/tests/models/test_law.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'gryTJ'}, queryset = []
msg = 'LawProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: LawProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
_________________ LearningMaterialProfileTests.test_get_length _________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_learning_material.LearningMaterialProfileTests testMethod=test_get_length>
def setUp(self):
super(LearningMaterialProfileTests, self).setUp()
load()
self.learning_profile = LearningMaterialProfile.objects.get(
> nice_key='lmf5fba'
)
profiles/tests/models/test_learning_material.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'lmf5fba'}, queryset = []
msg = 'LearningMaterialProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: LearningMaterialProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
_______________________ TutorProfileTests.test_get_logo ________________________
[gw1] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_tutor.TutorProfileTests testMethod=test_get_logo>
def test_get_logo(self):
"""
This function tests that the tutor company logo is correct
"""
> tutor = TutorProfile.objects.get(nice_key=TutorProfileTests.NICE_KEY)
profiles/tests/models/test_tutor.py:73:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'tufdbaf'}, queryset = []
msg = 'TutorProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: TutorProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
_____________________ MBAProfileTests.test_applicants_fail _____________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_mba.MBAProfileTests testMethod=test_applicants_fail>
def setUp(self):
super(MBAProfileTests, self).setUp()
MBAProfile(**load()).save()
> self.mba_profile = MBAProfile.objects.get(nice_key='bp69813')
profiles/tests/models/test_mba.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'bp69813'}, queryset = []
msg = 'MBAProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: MBAProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
_____________________ TutorProfileTests.test_get_subjects ______________________
[gw1] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_tutor.TutorProfileTests testMethod=test_get_subjects>
def test_get_subjects(self):
"""
Tests whether we get back the right subjects a tutor teaches
"""
> tutor = TutorProfile.objects.get(nice_key=TutorProfileTests.NICE_KEY)
profiles/tests/models/test_tutor.py:63:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'tufdbaf'}, queryset = []
msg = 'TutorProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: TutorProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
______________________ MBAProfileTests.test_applicants_ok ______________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_mba.MBAProfileTests testMethod=test_applicants_ok>
def setUp(self):
super(MBAProfileTests, self).setUp()
MBAProfile(**load()).save()
> self.mba_profile = MBAProfile.objects.get(nice_key='bp69813')
profiles/tests/models/test_mba.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'bp69813'}, queryset = []
msg = 'MBAProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: MBAProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
_________________________ TutorProfileTests.test_title _________________________
[gw1] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_tutor.TutorProfileTests testMethod=test_title>
def test_title(self):
"""
Tests whether we get back the right title/name of the tutor
"""
> tutor = TutorProfile.objects.get(nice_key=TutorProfileTests.NICE_KEY)
profiles/tests/models/test_tutor.py:21:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'tufdbaf'}, queryset = []
msg = 'TutorProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: TutorProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
___________________ MBAProfileTests.test_get_enrollment_data ___________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_mba.MBAProfileTests testMethod=test_get_enrollment_data>
def setUp(self):
super(MBAProfileTests, self).setUp()
MBAProfile(**load()).save()
> self.mba_profile = MBAProfile.objects.get(nice_key='bp69813')
profiles/tests/models/test_mba.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'bp69813'}, queryset = []
msg = 'MBAProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: MBAProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
____________________ MBAProfileTests.test_get_whiskers_fail ____________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_mba.MBAProfileTests testMethod=test_get_whiskers_fail>
def setUp(self):
super(MBAProfileTests, self).setUp()
MBAProfile(**load()).save()
> self.mba_profile = MBAProfile.objects.get(nice_key='bp69813')
profiles/tests/models/test_mba.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'bp69813'}, queryset = []
msg = 'MBAProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: MBAProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
_____________________ MBAProfileTests.test_get_whiskers_ok _____________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_mba.MBAProfileTests testMethod=test_get_whiskers_ok>
def setUp(self):
super(MBAProfileTests, self).setUp()
MBAProfile(**load()).save()
> self.mba_profile = MBAProfile.objects.get(nice_key='bp69813')
profiles/tests/models/test_mba.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'bp69813'}, queryset = []
msg = 'MBAProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: MBAProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
_____________________ MBAProfileTests.test_institution_ok ______________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_mba.MBAProfileTests testMethod=test_institution_ok>
def setUp(self):
super(MBAProfileTests, self).setUp()
MBAProfile(**load()).save()
> self.mba_profile = MBAProfile.objects.get(nice_key='bp69813')
profiles/tests/models/test_mba.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'bp69813'}, queryset = []
msg = 'MBAProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: MBAProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
______________ NursingSchoolProfileTests.test_get_desired_degree _______________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_nursing.NursingSchoolProfileTests testMethod=test_get_desired_degree>
def test_get_desired_degree(self):
"""
Tests wether our get_desired_degree function returns correct/right
formated degrees as string
"""
> nursing = NursingSchoolProfile.objects.get(nice_key=NursingSchoolProfileTests.NICE_KEY)
profiles/tests/models/test_nursing.py:75:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'nsd375d'}, queryset = []
msg = 'NursingSchoolProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: NursingSchoolProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
___________________ SchoolProfileTests.test_get_coed_ec_data ___________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_school.SchoolProfileTests testMethod=test_get_coed_ec_data>
def setUp(self):
super(SchoolProfileTests, self).setUp()
load()
# Set a sample school profile to be used for the tests.
self.stuyvesant_profile = SchoolProfile.objects.get(
> nice_key='ktDSL'
)
profiles/tests/models/test_school.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'ktDSL'}, queryset = []
msg = 'SchoolProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: SchoolProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
____________________ SchoolProfileTests.test_get_image_url _____________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_school.SchoolProfileTests testMethod=test_get_image_url>
def setUp(self):
super(SchoolProfileTests, self).setUp()
load()
# Set a sample school profile to be used for the tests.
self.stuyvesant_profile = SchoolProfile.objects.get(
> nice_key='ktDSL'
)
profiles/tests/models/test_school.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'ktDSL'}, queryset = []
msg = 'SchoolProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: SchoolProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
____________ InternshipProfileTemplatesTests.test_meta_description _____________
[gw1] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.templates.test_internship.InternshipProfileTemplatesTests testMethod=test_meta_description>
def test_meta_description(self):
"""
Tests if there is content in the meta description of the profile page
and checks if the meta description is the expected one
"""
url = reverse('internship_profile_view',
kwargs={'nice_key': 'inc8166'}
)
title = 'Technology Intern'
> response = self.client.get('%s/%s' % (url, slugify(unicode(title))))
profiles/tests/templates/test_internship.py:55:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python2.7/dist-packages/django/test/client.py:473: in get
response = super(Client, self).get(path, data=data, **extra)
/usr/local/lib/python2.7/dist-packages/django/test/client.py:280: in get
return self.request(**r)
/usr/local/lib/python2.7/dist-packages/django/test/client.py:444: in request
six.reraise(*exc_info)
/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py:112: in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py:69: in view
return self.dispatch(request, *args, **kwargs)
/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py:87: in dispatch
return handler(request, *args, **kwargs)
profiles/views.py:139: in get
response = LegacyLandingPageRedirectView.as_view()(request)
/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py:69: in view
return self.dispatch(request, *args, **kwargs)
/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py:87: in dispatch
return handler(request, *args, **kwargs)
search/legacy_landing_pages.py:205: in get
return super(LegacyLandingPageRedirectView, self).get(request, *args, **kwargs)
/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py:189: in get
url = self.get_redirect_url(*args, **kwargs)
search/legacy_landing_pages.py:183: in get_redirect_url
self.uri_params, self.category)
search/legacy_landing_pages.py:69: in get_url_tags_from_legacy_uri_params
category = Category.objects.get(slug=category)
/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py:151: in get
return self.get_queryset().get(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], args = (), kwargs = {'slug': 'internships'}, clone = [], num = 0
def get(self, *args, **kwargs):
"""
Performs the query and returns a single object matching the given
keyword arguments.
"""
clone = self.filter(*args, **kwargs)
if self.query.can_filter():
clone = clone.order_by()
num = len(clone)
if num == 1:
return clone._result_cache[0]
if not num:
raise self.model.DoesNotExist(
"%s matching query does not exist." %
> self.model._meta.object_name)
E DoesNotExist: Category matching query does not exist.
/usr/local/lib/python2.7/dist-packages/django/db/models/query.py:310: DoesNotExist
_______________ TutorProfileTemplatesTests.test_meta_description _______________
[gw0] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.templates.test_tutor.TutorProfileTemplatesTests testMethod=test_meta_description>
def test_meta_description(self):
"""
Tests if there is content in the meta description of the profile page
and checks if the meta description is the expected one
"""
url = reverse('tutor_profile_view', kwargs={'nice_key': 'tufdbaf'})
title = 'Lana P.'
response = self.client.get('%s/%s' % (url, slugify(unicode(title))))
html_page = BeautifulSoup(response.content)
> self.assertEqual(response.status_code, 200)
E AssertionError: 301 != 200
profiles/tests/templates/test_tutor.py:55: AssertionError
______________________ SchoolProfileTests.test_get_title _______________________
[gw2] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.models.test_school.SchoolProfileTests testMethod=test_get_title>
def setUp(self):
super(SchoolProfileTests, self).setUp()
load()
# Set a sample school profile to be used for the tests.
self.stuyvesant_profile = SchoolProfile.objects.get(
> nice_key='ktDSL'
)
profiles/tests/models/test_school.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], q_objs = (), query = {'nice_key': 'ktDSL'}, queryset = []
msg = 'SchoolProfile matching query does not exist.'
def get(self, *q_objs, **query):
"""Retrieve the the matching object raising
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
`DocumentName.MultipleObjectsReturned` exception if multiple results
and :class:`~mongoengine.queryset.DoesNotExist` or
`DocumentName.DoesNotExist` if no results are found.
.. versionadded:: 0.3
"""
queryset = self.clone()
queryset = queryset.limit(2)
queryset = queryset.filter(*q_objs, **query)
try:
result = queryset.next()
except StopIteration:
msg = ("%s matching query does not exist."
% queryset._document._class_name)
> raise queryset._document.DoesNotExist(msg)
E DoesNotExist: SchoolProfile matching query does not exist.
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:186: DoesNotExist
_ FunctionalUserProviderSerializerTests.test_create_provider_access_duplicate __
[gw0] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.providers.tests.test_serializers.FunctionalUserProviderSerializerTests testMethod=test_create_provider_access_duplicate>
def test_create_provider_access_duplicate(self):
"""
Test to ensure that the correct error comes back if a duplicate nkey + user
is requested.
"""
request = {
'user': NoodleUsers.objects.get(username='tuser@noodle.org').pk,
'noodle_id': 'in265ad140-bf1f-11e2-a441-e24413dccf74',
'category': 'internships',
'requested_by': NoodleUsers.objects.get(username='tuser@noodle.org').pk
}
serializer = serializers.CreateProviderAccessSerializer(data=request)
self.assertFalse(serializer.is_valid())
> self.assertEquals(serializer.errors['__all__'], [u'User provider access with this '
'User and Noodle id already exists.'])
E KeyError: '__all__'
providers/tests/test_serializers.py:30: KeyError
____________ InternshipProfileTemplatesTests.test_tile_description _____________
[gw1] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.templates.test_internship.InternshipProfileTemplatesTests testMethod=test_tile_description>
def test_tile_description(self):
"""
Tests if the dynamic description is generated and whether we get the
correct description at the template level
"""
url = reverse('internship_profile_view',
kwargs={'nice_key': 'inc8166'}
)
title = 'Technology Intern'
> response = self.client.get('%s/%s' % (url, slugify(unicode(title))))
profiles/tests/templates/test_internship.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python2.7/dist-packages/django/test/client.py:473: in get
response = super(Client, self).get(path, data=data, **extra)
/usr/local/lib/python2.7/dist-packages/django/test/client.py:280: in get
return self.request(**r)
/usr/local/lib/python2.7/dist-packages/django/test/client.py:444: in request
six.reraise(*exc_info)
/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py:112: in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py:69: in view
return self.dispatch(request, *args, **kwargs)
/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py:87: in dispatch
return handler(request, *args, **kwargs)
profiles/views.py:139: in get
response = LegacyLandingPageRedirectView.as_view()(request)
/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py:69: in view
return self.dispatch(request, *args, **kwargs)
/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py:87: in dispatch
return handler(request, *args, **kwargs)
search/legacy_landing_pages.py:205: in get
return super(LegacyLandingPageRedirectView, self).get(request, *args, **kwargs)
/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py:189: in get
url = self.get_redirect_url(*args, **kwargs)
search/legacy_landing_pages.py:183: in get_redirect_url
self.uri_params, self.category)
search/legacy_landing_pages.py:69: in get_url_tags_from_legacy_uri_params
category = Category.objects.get(slug=category)
/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py:151: in get
return self.get_queryset().get(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [], args = (), kwargs = {'slug': 'internships'}, clone = [], num = 0
def get(self, *args, **kwargs):
"""
Performs the query and returns a single object matching the given
keyword arguments.
"""
clone = self.filter(*args, **kwargs)
if self.query.can_filter():
clone = clone.order_by()
num = len(clone)
if num == 1:
return clone._result_cache[0]
if not num:
raise self.model.DoesNotExist(
"%s matching query does not exist." %
> self.model._meta.object_name)
E DoesNotExist: Category matching query does not exist.
/usr/local/lib/python2.7/dist-packages/django/db/models/query.py:310: DoesNotExist
_______________ FunctionalProviderTest.test_create_generate_nkey _______________
[gw0] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.providers.tests.test_views.FunctionalProviderTest testMethod=test_create_generate_nkey>
def test_create_generate_nkey(self):
"""
Test to ensure that the nkey gets generated on the request.
"""
url = reverse('generate_nkey_provider_access')
user = NoodleUsers.objects.get(username='tuser@noodle.org')
response = self.client.post(url, data=json.dumps({
'user': user.pk,
'category': 'internships',
'requested_by': user.pk
}), content_type='application/json', HTTP_AUTHORIZATION='Bearer ' + self.token.token)
content = json.loads(response.content)
> self.assertEquals(response.status_code, 201)
E AssertionError: 400 != 201
providers/tests/test_views.py:145: AssertionError
______________ FunctionalProviderTest.test_create_provider_access ______________
[gw0] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.providers.tests.test_views.FunctionalProviderTest testMethod=test_create_provider_access>
def test_create_provider_access(self):
"""
Test to ensure that we can create a user provider.
"""
url = reverse('create_provider_access')
user = NoodleUsers.objects.get(username='tuser@noodle.org')
response = self.client.post(url, data=json.dumps({
"user": user.pk,
"noodle_id": "co1a1x5d64v08ab3263514",
"category": "college institution",
"requested_by": user.pk,
}), content_type="application/json", HTTP_AUTHORIZATION='Bearer ' + self.token.token)
content = json.loads(response.content)
print content
provider_access = models.UserProviderAccess.objects.latest('pk')
> self.assertEquals(response.status_code, 201)
E AssertionError: 400 != 201
providers/tests/test_views.py:77: AssertionError
----------------------------- Captured stdout call -----------------------------
{u'category': [u'college institution is not a valid category.']}
______ LearningMaterialsProfileTemplatesTests.test_load_correct_template _______
[gw1] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.profiles.tests.templates.test_learning_material.LearningMaterialsProfileTemplatesTests testMethod=test_load_correct_template>
def test_load_correct_template(self):
"""
Tests whether we are loading the correct template to process the html
page
"""
url = reverse('learning_material_profile_view',
kwargs={'nice_key': '115808'})
title = 'Dreams From My Grandfather'
response = self.client.get('%s/%s' % (url, slugify(unicode(title))))
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(
response,
> template_name='profiles/learning_material/base_learning_material.html'
)
profiles/tests/templates/test_learning_material.py:30:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python2.7/dist-packages/django/test/testcases.py:542: in assertTemplateUsed
(template_name, ', '.join(template_names)))
E AssertionError: Template 'profiles/learning_material/base_learning_material.html' was not a template used to render the response. Actual template(s) used: components/header_nav.html, components/footer.html, base.html, pipeline/css.html, pipeline/css.html, pipeline/js.html, noodleauth/login_modal.html, base_modal.html, <Unknown Template>, bootstrap/field.html, bootstrap/layout/help_text_and_errors.html, bootstrap/layout/field_errors.html, bootstrap/layout/help_text.html, bootstrap/field.html, bootstrap/layout/help_text_and_errors.html, bootstrap/layout/field_errors.html, bootstrap/layout/help_text.html, <Unknown Template>, uni_form/layout/div.html, <Unknown Template>, bootstrap/layout/baseinput.html, uni_form/layout/div.html, uni_form/layout/div.html, uni_form/layout/div.html, bootstrap/whole_uni_form.html, bootstrap/display_form.html, bootstrap/errors.html, noodleauth/registration_modal.html, base_modal.html, <Unknown Template>, <Unknown Template>, bootstrap/field.html, bootstrap/layout/help_text_and_errors.html, bootstrap/layout/field_errors.html, bootstrap/layout/help_text.html, bootstrap/field.html, bootstrap/layout/help_text_and_errors.html, bootstrap/layout/field_errors.html, bootstrap/layout/help_text.html, bootstrap/field.html, bootstrap/layout/help_text_and_errors.html, bootstrap/layout/field_errors.html, bootstrap/layout/help_text.html, bootstrap/field.html, bootstrap/layout/help_text_and_errors.html, bootstrap/layout/field_errors.html, bootstrap/layout/help_text.html, <Unknown Template>, bootstrap/layout/baseinput.html, bootstrap/whole_uni_form.html, bootstrap/display_form.html, bootstrap/errors.html, noodleauth/clever_registration_modal.html, base_modal.html, <Unknown Template>, bootstrap/field.html, bootstrap/field.html, bootstrap/layout/help_text_and_errors.html, bootstrap/layout/field_errors.html, bootstrap/layout/help_text.html, bootstrap/field.html, bootstrap/layout/help_text_and_errors.html, bootstrap/layout/field_errors.html, bootstrap/layout/help_text.html, bootstrap/field.html, bootstrap/layout/help_text_and_errors.html, bootstrap/layout/field_errors.html, bootstrap/layout/help_text.html, <Unknown Template>, bootstrap/layout/baseinput.html, bootstrap/whole_uni_form.html, bootstrap/display_form.html, bootstrap/errors.html, components/notification.html, base_modal.html, components/notification.html, base_modal.html, questions/ask_a_question_modal.html, base_modal.html, bootstrap/field.html, bootstrap/layout/help_text_and_errors.html, bootstrap/layout/field_errors.html, bootstrap/layout/help_text.html, <Unknown Template>, uni_form/layout/div.html, uni_form/layout/div.html, <Unknown Template>, bootstrap/field.html, bootstrap/layout/help_text_and_errors.html, bootstrap/layout/field_errors.html, bootstrap/layout/help_text.html, bootstrap/field.html, bootstrap/layout/help_text_and_errors.html, bootstrap/layout/field_errors.html, bootstrap/layout/help_text.html, <Unknown Template>, <Unknown Template>, bootstrap/layout/button.html, <Unknown Template>, bootstrap/layout/button.html, uni_form/layout/div.html, uni_form/layout/div.html, <Unknown Template>, <Unknown Template>, bootstrap/layout/button.html, <Unknown Template>, bootstrap/layout/button.html, uni_form/layout/div.html, bootstrap/field.html, bootstrap/whole_uni_form.html, bootstrap/display_form.html, bootstrap/errors.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/js.html, pipeline/inline_js.html
________________ ScholarshipTests.test_create_participant_info _________________
[gw0] linux2 -- Python 2.7.3 /usr/bin/python
self = <noodleapi.scholarships.tests.test_views.ScholarshipTests testMethod=test_create_participant_info>
@pytest.mark.mongotest
def test_create_participant_info(self):
url = reverse('scholarship_participant_info', args=[self.scholarship.slug])
self.client.login(username=self.test_unregistered_user.username,
password='password123')
data = {
'phone_number': '1234567890',
'profile_nice_key': 'coN',
'landing_search_category': self.scholarship.category.seo_name,
'school_name_autocomplete': 'Brown University',
'participant_type': Participant.STUDENT,
'graduation_year': 2020,
'accept_terms': True,
}
> response = self.client.post(url, data)
scholarships/tests/test_views.py:336:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python2.7/dist-packages/django/test/client.py:483: in post
response = super(Client, self).post(path, data=data, content_type=content_type, **extra)
/usr/local/lib/python2.7/dist-packages/django/test/client.py:302: in post
return self.request(**r)
/usr/local/lib/python2.7/dist-packages/django/test/client.py:444: in request
six.reraise(*exc_info)
/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py:112: in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py:69: in view
return self.dispatch(request, *args, **kwargs)
/usr/local/lib/python2.7/dist-packages/braces/views/_access.py:64: in dispatch
request, *args, **kwargs)
/usr/local/lib/python2.7/dist-packages/braces/views/_access.py:357: in dispatch
request, *args, **kwargs)
/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py:87: in dispatch
return handler(request, *args, **kwargs)
scholarships/views.py:115: in post
profile_title = self.object.get_profile_title(profile_nice_key)
scholarships/models.py:187: in get_profile_title
nice_key=profile_nice_key).get_title()
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:182: in get
result = queryset.next()
/usr/local/lib/python2.7/dist-packages/mongoengine/queryset/base.py:1137: in next
raw_doc = self._cursor.next()
/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py:814: in next
if len(self.__data) or self._refresh():
/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py:763: in _refresh
self.__uuid_subtype))
/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py:720: in __send_message
self.__uuid_subtype)
/usr/local/lib/python2.7/dist-packages/pymongo/helpers.py:95: in _unpack_response
error_object = bson.BSON(response[20:]).decode()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = "\x9c\x00\x00\x00\x02$err\x00\x83\x00\x00\x00can't open database in a read loc...uery. might otherwise indicate an internal error\x00\x10code\x007>\x00\x00\x00"
as_class = <type 'dict'>, tz_aware = False, uuid_subtype = 3, compile_re = True
def decode(self, as_class=dict,
tz_aware=False, uuid_subtype=OLD_UUID_SUBTYPE, compile_re=True):
"""Decode this BSON data.
The default type to use for the resultant document is
:class:`dict`. Any other class that supports
:meth:`__setitem__` can be used instead by passing it as the
`as_class` parameter.
If `tz_aware` is ``True`` (recommended), any
:class:`~datetime.datetime` instances returned will be
timezone-aware, with their timezone set to
:attr:`bson.tz_util.utc`. Otherwise (default), all
:class:`~datetime.datetime` instances will be naive (but
contain UTC).
:Parameters:
- `as_class` (optional): the class to use for the resulting
document
- `tz_aware` (optional): if ``True``, return timezone-aware
:class:`~datetime.datetime` instances
- `compile_re` (optional): if ``False``, don't attempt to compile
BSON regular expressions into Python regular expressions. Return
instances of
:class:`~bson.regex.Regex` instead. Can avoid
:exc:`~bson.errors.InvalidBSON` errors when receiving
Python-incompatible regular expressions, for example from
``currentOp``
.. versionchanged:: 2.7
Added ``compile_re`` option.
.. versionadded:: 1.9
"""
(document, _) = _bson_to_dict(
> self, as_class, tz_aware, uuid_subtype, compile_re)
E TypeError: function takes exactly 4 arguments (5 given)
/usr/local/lib/python2.7/dist-packages/bson/__init__.py:624: TypeError
FunctionalCategorySearchViewTests.test_categorysearch_with_terms_logs_the_query
[gw0] linux2 -- Python 2.7.3 /usr/bin/python
args = (<noodleapi.search.tests.test_views.FunctionalCategorySearchViewTests testMethod=test_categorysearch_with_terms_logs_the_query>,)
keywargs = {}, extra_args = []
entered_patchers = [<mock._patch object at 0x6381d90>]
exc_info = (<type 'exceptions.TypeError'>, TypeError("'NoneType' object has no attribute '__getitem__'",), <traceback object at 0x9688950>)
patching = <mock._patch object at 0x6381d90>, arg = 1
@wraps(func)
def patched(*args, **keywargs):
# don't use a with here (backwards compatability with Python 2.4)
extra_args = []
entered_patchers = []
# can't use try...except...finally because of Python 2.4
# compatibility
exc_info = tuple()
try:
try:
for patching in patched.patchings:
arg = patching.__enter__()
entered_patchers.append(patching)
if patching.attribute_name is not None:
keywargs.update(arg)
elif patching.new is DEFAULT:
extra_args.append(arg)
args += tuple(extra_args)
> return func(*args, **keywargs)
/usr/local/lib/python2.7/dist-packages/mock.py:1201:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <noodleapi.search.tests.test_views.FunctionalCategorySearchViewTests testMethod=test_categorysearch_with_terms_logs_the_query>
def test_categorysearch_with_terms_logs_the_query (self):
"""
Test that when a text search is passed into a category search Solr
query, that the query is logged.
"""
category = 'tutoring'
url = reverse('category_search_view', kwargs={'category': category})
self.client.login(username=self.test_user.username,
password='password123')
self.client.get(url, {'terms': 'sat math'})
dbh = MongoClient(
host=settings.MONGODB['default']['HOST'],
port=int(settings.MONGODB['default']['PORT'])
)
log_collection = dbh[settings.MONGODB['default']['SCHEMA']]['log']
returned = log_collection.find_one({'search_term': 'sat math'})
> self.assertEquals('tutoring', returned['category'])
E TypeError: 'NoneType' object has no attribute '__getitem__'
search/tests/test_views.py:46: TypeError
=================== 44 failed, 966 passed in 525.32 seconds ====================
@darwinabella
Copy link

Are the failures in Mongo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment