From 0f897a7b3f752255f8ad3086dfc62168850a2292 Mon Sep 17 00:00:00 2001 From: bmedx Date: Fri, 22 Dec 2017 17:32:48 -0500 Subject: [PATCH] Fixes to teams tests in Django 1.9+ - add edx.org to lms tests KNOWN_HOSTS - Don't check CourseTeamMembership field mutability on creation --- lms/djangoapps/teams/models.py | 3 ++- lms/envs/test.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lms/djangoapps/teams/models.py b/lms/djangoapps/teams/models.py index 8e590fbaf3..1b41a258ed 100644 --- a/lms/djangoapps/teams/models.py +++ b/lms/djangoapps/teams/models.py @@ -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 diff --git a/lms/envs/test.py b/lms/envs/test.py index f717b65a55..f42194289b 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -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.