Merge pull request #17096 from edx/bmedx/django111_lms_unit_1_failures

Small fixes to LMS unit 1 failures in Django 1.11 tests
This commit is contained in:
Brian Mesick
2018-01-08 11:30:21 -05:00
committed by GitHub
5 changed files with 12 additions and 3 deletions

View File

@@ -89,6 +89,9 @@ class Bookmark(TimeStampedModel):
user = data.pop('user')
# Sometimes this ends up in data, but newer versions of Django will fail on having unknown keys in defaults
data.pop('display_name', None)
bookmark, created = cls.objects.get_or_create(usage_key=usage_key, user=user, defaults=data)
return bookmark, created

View File

@@ -23,7 +23,6 @@ class BookmarkFactory(DjangoModelFactory):
user = factory.SubFactory(UserFactory)
course_key = COURSE_KEY
usage_key = LOCATION('usage_id')
path = list()
xblock_cache = factory.SubFactory(
'openedx.core.djangoapps.bookmarks.tests.factories.XBlockCacheFactory',
course_key=factory.SelfAttribute('..course_key'),