Skip to content

Commit

Permalink
Fix part of oppia#7450: Modify private methods in UserLastExploration…
Browse files Browse the repository at this point in the history
…ActivityOneOffJobTests (oppia#7824)

* Changed private method calls to pulic method calls.

* Changed private method calls to public method calls

* Changed private method calls to public method calls

* Changed private method calls to public method calls
  • Loading branch information
Hudda authored and seanlip committed Oct 25, 2019
1 parent 0061d13 commit dcea2ac
Showing 1 changed file with 27 additions and 17 deletions.
44 changes: 27 additions & 17 deletions core/domain/user_jobs_one_off_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1216,9 +1216,11 @@ def test_that_last_created_time_is_updated(self):
self.exp_id, self.owner_id, end_state_name='End')
self.logout()

user_settings = user_services.get_user_settings(self.owner_id)
user_settings.last_created_an_exploration = None
user_services._save_user_settings(user_settings) # pylint: disable=protected-access
user_models.UserSettingsModel(
id=self.owner_id,
email=self.OWNER_EMAIL,
last_created_an_exploration=None
).put()

owner_settings = user_services.get_user_settings(self.owner_id)
self.assertIsNone(owner_settings.last_created_an_exploration)
Expand All @@ -1244,9 +1246,11 @@ def test_that_last_edited_time_is_updated(self):
})], 'Test edit')
self.logout()

user_settings = user_services.get_user_settings(self.editor_id)
user_settings.last_edited_an_exploration = None
user_services._save_user_settings(user_settings) # pylint: disable=protected-access
user_models.UserSettingsModel(
id=self.editor_id,
email=self.EDITOR_EMAIL,
last_edited_an_exploration=None
).put()

editor_settings = user_services.get_user_settings(self.editor_id)

Expand Down Expand Up @@ -1280,14 +1284,18 @@ def test_that_last_edited_and_created_time_both_updated(self):
})], 'Test edit new')
self.logout()

user_settings = user_services.get_user_settings(self.owner_id)
user_settings.last_created_an_exploration = None
user_settings.last_edited_an_exploration = None
user_services._save_user_settings(user_settings) # pylint: disable=protected-access
user_models.UserSettingsModel(
id=self.owner_id,
email=self.OWNER_EMAIL,
last_created_an_exploration=None,
last_edited_an_exploration=None
).put()

user_settings = user_services.get_user_settings(self.editor_id)
user_settings.last_edited_an_exploration = None
user_services._save_user_settings(user_settings) # pylint: disable=protected-access
user_models.UserSettingsModel(
id=self.editor_id,
email=self.EDITOR_EMAIL,
last_edited_an_exploration=None
).put()

owner_settings = user_services.get_user_settings(self.owner_id)
editor_settings = user_services.get_user_settings(self.editor_id)
Expand All @@ -1308,10 +1316,12 @@ def test_that_last_edited_and_created_time_both_updated(self):
self.assertIsNone(editor_settings.last_created_an_exploration)

def test_that_last_edited_and_created_time_are_not_updated(self):
user_settings = user_services.get_user_settings(self.owner_id)
user_settings.last_created_an_exploration = None
user_settings.last_edited_an_exploration = None
user_services._save_user_settings(user_settings) # pylint: disable=protected-access
user_models.UserSettingsModel(
id=self.owner_id,
email=self.OWNER_EMAIL,
last_created_an_exploration=None,
last_edited_an_exploration=None
).put()

owner_settings = user_services.get_user_settings(self.owner_id)

Expand Down

0 comments on commit dcea2ac

Please sign in to comment.