Fixes to teams tests in Django 1.9+

- add edx.org to lms tests KNOWN_HOSTS
- Don't check CourseTeamMembership field mutability on creation
This commit is contained in:
bmedx
2017-12-22 17:32:48 -05:00
committed by John Eskew
parent 4fc20cb291
commit 0f897a7b3f
2 changed files with 3 additions and 1 deletions

View File

@@ -182,7 +182,8 @@ class CourseTeamMembership(models.Model):
"""Memberships are immutable, with the exception of last activity
date.
"""
if name in self.immutable_fields:
creating_model = name == '_state' or self._state.adding
if not creating_model and name in self.immutable_fields:
# Check the current value -- if it is None, then this
# model is being created from the database and it's fine
# to set the value. Otherwise, we're trying to overwrite

View File

@@ -41,6 +41,7 @@ ALLOWED_HOSTS = [
'.testserver.fake',
'test-site.testserver',
'testserver.fakeother',
'edx.org'
]
# Silence noisy logs to make troubleshooting easier when tests fail.