Commit 54b0a465 by David Ormsbee

Ugly hack so that an LMS-specific test of the shared Student djangoapp doesn't break CMS test runs

parent e8ac66fc
...@@ -28,6 +28,8 @@ class ReplicationTest(TestCase): ...@@ -28,6 +28,8 @@ class ReplicationTest(TestCase):
portal_user.last_login=datetime(2012, 1, 1) portal_user.last_login=datetime(2012, 1, 1)
portal_user.date_joined=datetime(2011, 1, 1) portal_user.date_joined=datetime(2011, 1, 1)
# This is an Askbot field and will break if askbot is not included # This is an Askbot field and will break if askbot is not included
if hasattr(portal_user, 'seen_response_count'):
portal_user.seen_response_count = 10 portal_user.seen_response_count = 10
portal_user.save(using='default') portal_user.save(using='default')
...@@ -45,13 +47,18 @@ class ReplicationTest(TestCase): ...@@ -45,13 +47,18 @@ class ReplicationTest(TestCase):
field, portal_user, course_user field, portal_user, course_user
)) ))
if hasattr(portal_user, 'seen_response_count'):
# Since it's the first copy over of User data, we should have all of it # Since it's the first copy over of User data, we should have all of it
self.assertEqual(portal_user.seen_response_count, self.assertEqual(portal_user.seen_response_count,
course_user.seen_response_count) course_user.seen_response_count)
# But if we replicate again, the user already exists in the Course DB, # But if we replicate again, the user already exists in the Course DB,
# so it shouldn't update the seen_response_count (which is Askbot # so it shouldn't update the seen_response_count (which is Askbot
# controlled) # controlled).
# This hasattr lameness is here because we don't want this test to be
# triggered when we're being run by CMS tests (Askbot doesn't exist
# there, so the test will fail).
if hasattr(portal_user, 'seen_response_count'):
portal_user.seen_response_count = 20 portal_user.seen_response_count = 20
replicate_user(portal_user, COURSE_1) replicate_user(portal_user, COURSE_1)
course_user = User.objects.using(COURSE_1).get(id=portal_user.id) course_user = User.objects.using(COURSE_1).get(id=portal_user.id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment