Repository: oppia/oppia

Issue:
[Contributor Dashboard] Set reviewer IDs for new question suggestions to None instead of empty string.
[Code](https://github.com/oppia/oppia/blob/develop/core/templates/pages/community-dashboard-page/services/question-suggestion.service.ts#L32)

When a new question suggestion is created, the reviewer ID fields are set to empty strings. This is causing data validation issues in the user ID migration (replacing the existing user IDs with a new format that are sure to be unique), as fields that are not None are assumed to have a valid value.

[Contributor Dashboard] Set reviewer IDs for new question suggestions to None instead of empty string.
[Code](https://github.com/oppia/oppia/blob/develop/core/templates/pages/community-dashboard-page/services/question-suggestion.service.ts#L32)

When a new question suggestion is created, the reviewer ID fields are set to empty strings. This is causing data validation issues in the user ID migration (replacing the existing user IDs with a new format that are sure to be unique), as fields that are not None are assumed to have a valid value.



Discussion:
Also, add some validation to the `last_reviewer_id` in places where it makes sense.
Specifically, please make sure that all the fields of each domain object are fully validated (with a validate() function) before any PUT to the datastore.

We should do an audit to list all models which don't have a corresponding validate() before PUT, otherwise this sort of thing is going to cause us more problems in the future. Ideally validate() is an automatic mandatory part of the PUT pipeline. /cc @ankita240796 
More specifically for all the fields that contain user IDs we should do specific checks (right now we have https://github.com/oppia/oppia/blob/develop/core/domain/user_id_migration.py#L47 for the new IDs format, which might be later moved maybe to user_services.py)  
Also, add some validation to the `last_reviewer_id` in places where it makes sense.
Specifically, please make sure that all the fields of each domain object are fully validated (with a validate() function) before any PUT to the datastore.

We should do an audit to list all models which don't have a corresponding validate() before PUT, otherwise this sort of thing is going to cause us more problems in the future. Ideally validate() is an automatic mandatory part of the PUT pipeline. /cc @ankita240796 
More specifically for all the fields that contain user IDs we should do specific checks (right now we have https://github.com/oppia/oppia/blob/develop/core/domain/user_id_migration.py#L47 for the new IDs format, which might be later moved maybe to user_services.py)  

Resolving patch:
diff --git a/core/controllers/suggestion.py b/core/controllers/suggestion.py
--- a/core/controllers/suggestion.py
+++ b/core/controllers/suggestion.py
@@ -103,13 +103,15 @@ class SuggestionHandler(base.BaseHandler):
 
     @acl_decorators.can_suggest_changes
     def post(self):
-        suggestion_services.create_suggestion(
-            self.payload.get('suggestion_type'),
-            self.payload.get('target_type'), self.payload.get('target_id'),
-            self.payload.get('target_version_at_submission'),
-            self.user_id, self.payload.get('change'),
-            self.payload.get('description'),
-            self.payload.get('final_reviewer_id'))
+        try:
+            suggestion_services.create_suggestion(
+                self.payload.get('suggestion_type'),
+                self.payload.get('target_type'), self.payload.get('target_id'),
+                self.payload.get('target_version_at_submission'),
+                self.user_id, self.payload.get('change'),
+                self.payload.get('description'))
+        except utils.ValidationError as e:
+            raise self.InvalidInputException(e)
         self.render_json(self.values)
 
 
diff --git a/core/domain/suggestion_registry.py b/core/domain/suggestion_registry.py
--- a/core/domain/suggestion_registry.py
+++ b/core/domain/suggestion_registry.py
@@ -28,6 +28,7 @@
 from core.domain import skill_domain
 from core.domain import skill_services
 from core.domain import state_domain
+from core.domain import user_id_migration
 from core.domain import user_services
 from core.platform import models
 import feconf
@@ -156,11 +157,27 @@ def validate(self):
                 'Expected author_id to be a string, received %s' % type(
                     self.author_id))
 
-        if not isinstance(self.final_reviewer_id, python_utils.BASESTRING):
-            if self.final_reviewer_id:
+        if (
+                self.author_id is not None and
+                not user_id_migration.verify_user_id_correct(self.author_id)
+        ):
+            raise utils.ValidationError(
+                'Expected author_id to be in a valid user ID format, '
+                'received %s' % self.author_id)
+
+        if self.final_reviewer_id is not None:
+            if not isinstance(self.final_reviewer_id, python_utils.BASESTRING):
                 raise utils.ValidationError(
                     'Expected final_reviewer_id to be a string, received %s' %
                     type(self.final_reviewer_id))
+            if (
+                    not user_id_migration.verify_user_id_correct(
+                        self.final_reviewer_id) and
+                    self.final_reviewer_id != feconf.SUGGESTION_BOT_USER_ID
+            ):
+                raise utils.ValidationError(
+                    'Expected final_reviewer_id to be in a valid user ID '
+                    'format, received %s' % self.final_reviewer_id)
 
         if not isinstance(self.score_category, python_utils.BASESTRING):
             raise utils.ValidationError(
@@ -259,7 +276,7 @@ class SuggestionEditStateContent(BaseSuggestion):
     def __init__( # pylint: disable=super-init-not-called
             self, suggestion_id, target_id, target_version_at_submission,
             status, author_id, final_reviewer_id,
-            change, score_category, last_updated):
+            change, score_category, last_updated=None):
         """Initializes an object of type SuggestionEditStateContent
         corresponding to the SUGGESTION_TYPE_EDIT_STATE_CONTENT choice.
         """
@@ -422,7 +439,7 @@ class SuggestionTranslateContent(BaseSuggestion):
     def __init__( # pylint: disable=super-init-not-called
             self, suggestion_id, target_id, target_version_at_submission,
             status, author_id, final_reviewer_id,
-            change, score_category, last_updated):
+            change, score_category, last_updated=None):
         """Initializes an object of type SuggestionTranslateContent
         corresponding to the SUGGESTION_TYPE_TRANSLATE_CONTENT choice.
         """
@@ -545,7 +562,7 @@ class SuggestionAddQuestion(BaseSuggestion):
     def __init__( # pylint: disable=super-init-not-called
             self, suggestion_id, target_id, target_version_at_submission,
             status, author_id, final_reviewer_id,
-            change, score_category, last_updated):
+            change, score_category, last_updated=None):
         """Initializes an object of type SuggestionAddQuestion
         corresponding to the SUGGESTION_TYPE_ADD_QUESTION choice.
         """
diff --git a/core/domain/suggestion_services.py b/core/domain/suggestion_services.py
--- a/core/domain/suggestion_services.py
+++ b/core/domain/suggestion_services.py
@@ -38,7 +38,7 @@
 
 def create_suggestion(
         suggestion_type, target_type, target_id, target_version_at_submission,
-        author_id, change, description, final_reviewer_id):
+        author_id, change, description):
     """Creates a new SuggestionModel and the corresponding FeedbackThread.
 
     Args:
@@ -53,8 +53,6 @@ def create_suggestion(
         author_id: str. The ID of the user who submitted the suggestion.
         change: dict. The details of the suggestion.
         description: str. The description of the changes provided by the author.
-        final_reviewer_id: str|None. The ID of the reviewer who has
-            accepted/rejected the suggestion.
     """
     if description is None:
         description = DEFAULT_SUGGESTION_THREAD_SUBJECT
@@ -87,10 +85,18 @@ def create_suggestion(
     else:
         raise Exception('Invalid suggestion type %s' % suggestion_type)
 
+    suggestion_domain_class = (
+        suggestion_registry.SUGGESTION_TYPES_TO_DOMAIN_CLASSES[
+            suggestion_type])
+    suggestion = suggestion_domain_class(
+        thread_id, target_id, target_version_at_submission, status, author_id,
+        None, change, score_category)
+    suggestion.validate()
+
     suggestion_models.GeneralSuggestionModel.create(
         suggestion_type, target_type, target_id,
         target_version_at_submission, status, author_id,
-        final_reviewer_id, change, score_category, thread_id)
+        None, change, score_category, thread_id)
 
 
 def get_suggestion_from_model(suggestion_model):


Test patch:
diff --git a/core/controllers/acl_decorators_test.py b/core/controllers/acl_decorators_test.py
--- a/core/controllers/acl_decorators_test.py
+++ b/core/controllers/acl_decorators_test.py
@@ -1465,7 +1465,7 @@ def setUp(self):
             self.SUGGESTION_TYPE, self.TARGET_TYPE,
             self.exploration_id, self.target_version_id,
             self.author_id,
-            self.change_dict, '', None)
+            self.change_dict, '')
         suggestion = suggestion_services.query_suggestions(
             [('author_id', self.author_id),
              ('target_id', self.exploration_id)])[0]
@@ -1535,7 +1535,7 @@ def setUp(self):
             self.SUGGESTION_TYPE, self.TARGET_TYPE,
             self.EXPLORATION_ID, self.TARGET_VERSION_ID,
             self.author_id,
-            self.CHANGE_DICT, '', None)
+            self.CHANGE_DICT, '')
         suggestion = suggestion_services.query_suggestions(
             [('author_id', self.author_id),
              ('target_id', self.EXPLORATION_ID)])[0]
diff --git a/core/controllers/creator_dashboard_test.py b/core/controllers/creator_dashboard_test.py
--- a/core/controllers/creator_dashboard_test.py
+++ b/core/controllers/creator_dashboard_test.py
@@ -844,7 +844,7 @@ def test_get_suggestions_list(self):
         self.save_new_default_exploration('exploration_id', self.owner_id)
         suggestion_services.create_suggestion(
             'edit_exploration_state_content', 'exploration',
-            'exploration_id', 1, self.owner_id, change_dict, '', None)
+            'exploration_id', 1, self.owner_id, change_dict, '')
         suggestions = self.get_json(
             feconf.CREATOR_DASHBOARD_DATA_URL)['created_suggestions_list'][0]
         change_dict['old_value'] = {
diff --git a/core/controllers/cron_test.py b/core/controllers/cron_test.py
--- a/core/controllers/cron_test.py
+++ b/core/controllers/cron_test.py
@@ -284,6 +284,7 @@ def test_cron_accept_stale_suggestions_handler(self):
         self.login(self.ADMIN_EMAIL, is_super_admin=True)
         self.save_new_valid_exploration(
             'exp_id', self.admin_id, title='A title', category='Algebra')
+        author_id = self.get_user_id_from_email(self.ADMIN_EMAIL)
 
         new_content = state_domain.SubtitledHtml(
             'content', '<p>new suggestion content</p>').to_dict()
@@ -297,7 +298,7 @@ def test_cron_accept_stale_suggestions_handler(self):
             suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
             suggestion_models.TARGET_TYPE_EXPLORATION,
             'exp_id', 1,
-            feconf.SYSTEM_COMMITTER_ID, change, 'change title', None)
+            author_id, change, 'change title')
 
         exploration = exp_fetchers.get_exploration_by_id('exp_id')
         self.assertEqual(
diff --git a/core/controllers/feedback_test.py b/core/controllers/feedback_test.py
--- a/core/controllers/feedback_test.py
+++ b/core/controllers/feedback_test.py
@@ -531,7 +531,7 @@ def test_feedback_threads_with_suggestions(self):
         suggestion_services.create_suggestion(
             suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
             suggestion_models.TARGET_TYPE_EXPLORATION, self.EXP_ID, 1,
-            self.user_id, change_cmd, 'sample description', None)
+            self.user_id, change_cmd, 'sample description')
 
         response = self.get_json(
             '%s/%s' % (
@@ -600,7 +600,7 @@ def test_post_feedback_threads_with_updated_suggestion_status_raises_400(
         suggestion_services.create_suggestion(
             suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
             suggestion_models.TARGET_TYPE_EXPLORATION, self.EXP_ID, 1,
-            self.owner_id_1, change, 'sample description', None)
+            self.owner_id_1, change, 'sample description')
 
         thread_id = suggestion_services.query_suggestions(
             [('author_id', self.owner_id_1),
diff --git a/core/controllers/suggestion_test.py b/core/controllers/suggestion_test.py
--- a/core/controllers/suggestion_test.py
+++ b/core/controllers/suggestion_test.py
@@ -126,7 +126,6 @@ def setUp(self):
                     'new_value': self.new_content
                 },
                 'description': 'change to state 1',
-                'final_reviewer_id': self.editor_id,
             }, csrf_token=csrf_token)
         self.logout()
 
@@ -150,7 +149,6 @@ def setUp(self):
                     'new_value': self.new_content
                 },
                 'description': 'change to state 2',
-                'final_reviewer_id': self.editor_id,
             }, csrf_token=csrf_token)
 
         self.post_json(
@@ -170,7 +168,6 @@ def setUp(self):
                     'new_value': self.new_content
                 },
                 'description': 'change to state 3',
-                'final_reviewer_id': self.editor_id,
             }, csrf_token=csrf_token)
         self.logout()
 
@@ -192,7 +189,6 @@ def setUp(self):
                     'translation_html': '<p>In Hindi</p>'
                 },
                 'description': 'change to state 3',
-                'final_reviewer_id': self.reviewer_id,
             }, csrf_token=csrf_token)
         self.logout()
 
@@ -225,6 +221,39 @@ def test_create_suggestion(self):
         self.assertEqual(len(suggestions), 3)
         self.logout()
 
+    def test_create_suggestion_invalid_target_version_input(self):
+        self.login(self.AUTHOR_EMAIL_2)
+        csrf_token = self.get_new_csrf_token()
+
+        response = self.post_json(
+            '%s/' % feconf.SUGGESTION_URL_PREFIX, {
+                'suggestion_type': (
+                    suggestion_models
+                    .SUGGESTION_TYPE_EDIT_STATE_CONTENT),
+                'target_type': (
+                    suggestion_models.TARGET_TYPE_EXPLORATION),
+                'target_id': 'exp1',
+                'target_version_at_submission': 'invalid target version',
+                'change': {
+                    'cmd': exp_domain.CMD_EDIT_STATE_PROPERTY,
+                    'property_name': exp_domain.STATE_PROPERTY_CONTENT,
+                    'state_name': 'State 3',
+                    'new_value': self.new_content
+                },
+                'description': 'change again to state 3',
+            }, csrf_token=csrf_token, expected_status_int=400)
+        suggestions = self.get_json(
+            '%s?author_id=%s' % (
+                feconf.SUGGESTION_LIST_URL_PREFIX,
+                self.author_id_2))['suggestions']
+
+        self.assertEqual(
+            response['error'],
+            'Expected target_version_at_submission to be an int, received <type'
+            ' \'unicode\'>')
+        self.assertEqual(len(suggestions), 2)
+        self.logout()
+
     def test_suggestion_to_exploration_handler_with_invalid_suggestion_id(self):
         self.login(self.EDITOR_EMAIL)
 
@@ -274,7 +303,8 @@ def test_suggestion_to_exploration_handler_with_invalid_target_type(self):
                 'default_state').to_dict(),
             'language_code': 'en',
             'question_state_data_schema_version': (
-                feconf.CURRENT_STATE_SCHEMA_VERSION)
+                feconf.CURRENT_STATE_SCHEMA_VERSION),
+            'linked_skill_ids': ['skill_id']
         }
 
         exp_id = 'new_exp_id'
@@ -290,7 +320,7 @@ def test_suggestion_to_exploration_handler_with_invalid_target_type(self):
                 'question_dict': question_dict,
                 'skill_id': None,
                 'skill_difficulty': 0.3
-            }, None, None)
+            }, None)
 
         suggestion_id = suggestion_services.query_suggestions(
             [('author_id', self.author_id), (
@@ -358,7 +388,7 @@ def test_owner_of_exploration_cannot_repond_to_own_suggestion(self):
         suggestion_services.create_suggestion(
             suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
             suggestion_models.TARGET_TYPE_EXPLORATION, exp_id, 1,
-            self.editor_id, change_cmd, 'sample description', None)
+            self.editor_id, change_cmd, 'sample description')
 
         suggestion_id = suggestion_services.query_suggestions(
             [('author_id', self.editor_id), (
@@ -862,7 +892,7 @@ def test_suggestion_to_skill_handler_with_invalid_target_type(self):
         suggestion_services.create_suggestion(
             suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
             suggestion_models.TARGET_TYPE_EXPLORATION, exp_id, 1,
-            self.author_id, change_cmd, 'sample description', None)
+            self.author_id, change_cmd, 'sample description')
 
         suggestion_id = suggestion_services.query_suggestions(
             [('author_id', self.author_id), (
@@ -1051,7 +1081,7 @@ def setUp(self):
         self.SKILL_DESCRIPTION = 'skill to link question to'
         exploration = self.save_new_valid_exploration(
             self.EXP_ID, self.owner_id, title='Exploration title',
-            end_state_name='End State')
+            category='Algebra', end_state_name='End State')
         self.publish_exploration(self.owner_id, self.EXP_ID)
 
         topic = topic_domain.Topic.create_default_topic(
@@ -1091,9 +1121,6 @@ def setUp(self):
 
         # Login and create exploration and suggestions.
         self.login(self.EDITOR_EMAIL)
-        self.save_new_linear_exp_with_state_names_and_interactions(
-            self.EXP_ID, self.editor_id, ['State 1', 'State 2', 'State 3'],
-            ['TextInput'], category='Algebra')
 
         exp_services.update_exploration(
             self.owner_id, self.EXP_ID, [
@@ -1128,7 +1155,6 @@ def setUp(self):
                     'translation_html': '<p>new content html in Hindi</p>'
                 },
                 'description': 'Adds translation',
-                'final_reviewer_id': None
             }, csrf_token=csrf_token)
 
         self.question_dict = {
@@ -1228,7 +1254,7 @@ def setUp(self):
         self.SKILL_DESCRIPTION = 'skill to link question to'
         exploration = self.save_new_valid_exploration(
             self.EXP_ID, self.owner_id, title='Exploration title',
-            end_state_name='End State')
+            category='Algebra', end_state_name='End State')
         self.publish_exploration(self.owner_id, self.EXP_ID)
 
         topic = topic_domain.Topic.create_default_topic(
@@ -1269,11 +1295,8 @@ def setUp(self):
         user_services.allow_user_to_review_question(self.reviewer_id)
         user_services.allow_user_to_review_translation_in_language(
             self.reviewer_id, 'hi')
-        # Login and create exploration and suggestions.
+        # Login and update exploration and suggestions.
         self.login(self.EDITOR_EMAIL)
-        self.save_new_linear_exp_with_state_names_and_interactions(
-            self.EXP_ID, self.editor_id, ['State 1', 'State 2', 'State 3'],
-            ['TextInput'], category='Algebra')
 
         exp_services.update_exploration(
             self.owner_id, self.EXP_ID, [
@@ -1308,7 +1331,6 @@ def setUp(self):
                     'translation_html': '<p>new content html in Hindi</p>'
                 },
                 'description': 'Adds translation',
-                'final_reviewer_id': None
             }, csrf_token=csrf_token)
 
         self.question_dict = {
diff --git a/core/controllers/tasks_test.py b/core/controllers/tasks_test.py
--- a/core/controllers/tasks_test.py
+++ b/core/controllers/tasks_test.py
@@ -165,8 +165,7 @@ def __init__(
                     suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                     suggestion_models.TARGET_TYPE_EXPLORATION,
                     self.exploration.id, 1,
-                    self.user_id_a, change, 'test description',
-                    None)
+                    self.user_id_a, change, 'test description')
                 threadlist = feedback_services.get_all_threads(
                     suggestion_models.TARGET_TYPE_EXPLORATION,
                     self.exploration.id, True)
diff --git a/core/domain/exp_services_test.py b/core/domain/exp_services_test.py
--- a/core/domain/exp_services_test.py
+++ b/core/domain/exp_services_test.py
@@ -187,7 +187,7 @@ def test_get_exploration_titles_and_categories(self):
         self.assertEqual(
             exp_services.get_exploration_titles_and_categories(['A']), {
                 'A': {
-                    'category': 'A category',
+                    'category': 'Algebra',
                     'title': 'TitleA'
                 }
             })
@@ -196,25 +196,25 @@ def test_get_exploration_titles_and_categories(self):
         self.assertEqual(
             exp_services.get_exploration_titles_and_categories(['A']), {
                 'A': {
-                    'category': 'A category',
+                    'category': 'Algebra',
                     'title': 'TitleA'
                 }
             })
         self.assertEqual(
             exp_services.get_exploration_titles_and_categories(['A', 'B']), {
                 'A': {
-                    'category': 'A category',
+                    'category': 'Algebra',
                     'title': 'TitleA',
                 },
                 'B': {
-                    'category': 'A category',
+                    'category': 'Algebra',
                     'title': 'TitleB',
                 },
             })
         self.assertEqual(
             exp_services.get_exploration_titles_and_categories(['A', 'C']), {
                 'A': {
-                    'category': 'A category',
+                    'category': 'Algebra',
                     'title': 'TitleA'
                 }
             })
@@ -3810,7 +3810,7 @@ def test_update_exploration_with_empty_change_list_does_not_update(self):
         exploration = self.save_new_default_exploration('exp_id', 'user_id')
 
         self.assertEqual(exploration.title, 'A title')
-        self.assertEqual(exploration.category, 'A category')
+        self.assertEqual(exploration.category, 'Algebra')
         self.assertEqual(
             exploration.objective, feconf.DEFAULT_EXPLORATION_OBJECTIVE)
         self.assertEqual(exploration.language_code, 'en')
@@ -3821,7 +3821,7 @@ def test_update_exploration_with_empty_change_list_does_not_update(self):
         exploration = exp_fetchers.get_exploration_by_id('exp_id')
 
         self.assertEqual(exploration.title, 'A title')
-        self.assertEqual(exploration.category, 'A category')
+        self.assertEqual(exploration.category, 'Algebra')
         self.assertEqual(
             exploration.objective, feconf.DEFAULT_EXPLORATION_OBJECTIVE)
         self.assertEqual(exploration.language_code, 'en')
diff --git a/core/domain/suggestion_jobs_one_off_test.py b/core/domain/suggestion_jobs_one_off_test.py
--- a/core/domain/suggestion_jobs_one_off_test.py
+++ b/core/domain/suggestion_jobs_one_off_test.py
@@ -144,8 +144,7 @@ def test_for_html_in_suggestions_with_math_rte(self):
                 suggestion_models.SUGGESTION_TYPE_TRANSLATE_CONTENT,
                 suggestion_models.TARGET_TYPE_EXPLORATION,
                 self.target_id, self.target_version_at_submission,
-                self.author_id, add_translation_change_dict, 'test description',
-                self.reviewer_id)
+                self.author_id, add_translation_change_dict, 'test description')
         answer_group = {
             'outcome': {
                 'dest': None,
@@ -269,7 +268,7 @@ def test_for_html_in_suggestions_with_math_rte(self):
                 suggestion_models.TARGET_TYPE_SKILL,
                 'skill1', feconf.CURRENT_STATE_SCHEMA_VERSION,
                 self.author_id, suggestion_dict_with_math['change'],
-                'test description', self.reviewer_id)
+                'test description')
 
         job_id = (
             suggestion_jobs_one_off.
@@ -366,8 +365,7 @@ def test_for_html_in_suggestion_edit_content_with_math_rte(self):
                 suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                 suggestion_models.TARGET_TYPE_EXPLORATION,
                 self.target_id, self.target_version_at_submission,
-                self.author_id, change_dict, 'test description',
-                self.reviewer_id)
+                self.author_id, change_dict, 'test description')
 
         job_id = (
             suggestion_jobs_one_off.
@@ -508,7 +506,7 @@ def test_for_html_in_suggestion_with_no_math_rte(self):
                 suggestion_models.TARGET_TYPE_SKILL,
                 'skill1', feconf.CURRENT_STATE_SCHEMA_VERSION,
                 self.author_id, suggestion_dict_without_math['change'],
-                'test description', self.reviewer_id)
+                'test description')
 
         job_id = (
             suggestion_jobs_one_off.
@@ -625,8 +623,7 @@ def test_migrate_suggestion_with_math_rte_correctly(self):
                 suggestion_models.SUGGESTION_TYPE_TRANSLATE_CONTENT,
                 suggestion_models.TARGET_TYPE_EXPLORATION,
                 self.target_id, self.target_version_at_submission,
-                self.author_id, add_translation_change_dict, 'test description',
-                self.reviewer_id)
+                self.author_id, add_translation_change_dict, 'test description')
         answer_group = {
             'outcome': {
                 'dest': None,
@@ -745,8 +742,7 @@ def test_migrate_suggestion_with_math_rte_correctly(self):
                 suggestion_models.SUGGESTION_TYPE_ADD_QUESTION,
                 suggestion_models.TARGET_TYPE_SKILL,
                 'skill1', feconf.CURRENT_STATE_SCHEMA_VERSION,
-                self.author_id, suggestion_dict['change'], 'test description',
-                self.reviewer_id)
+                self.author_id, suggestion_dict['change'], 'test description')
         job_id = (
             suggestion_jobs_one_off.
             SuggestionMathMigrationOneOffJob.create_new())
@@ -876,8 +872,7 @@ def test_migrate_in_suggestion_edit_content_with_math_rte_correctly(self):
                 suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                 suggestion_models.TARGET_TYPE_EXPLORATION,
                 self.target_id, self.target_version_at_submission,
-                self.author_id, change_dict, 'test description',
-                self.reviewer_id)
+                self.author_id, change_dict, 'test description')
 
         job_id = (
             suggestion_jobs_one_off.
@@ -975,8 +970,7 @@ def test_skip_migration_for_suggestion_with_new_math_schema(self):
                 suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                 suggestion_models.TARGET_TYPE_EXPLORATION,
                 self.target_id, self.target_version_at_submission,
-                self.author_id, change_dict, 'test description',
-                self.reviewer_id)
+                self.author_id, change_dict, 'test description')
 
         job_id = (
             suggestion_jobs_one_off.
@@ -1111,8 +1105,7 @@ def test_migration_skips_suggestions_failing_validation(self):
                 suggestion_models.SUGGESTION_TYPE_ADD_QUESTION,
                 suggestion_models.TARGET_TYPE_SKILL,
                 'skill1', feconf.CURRENT_STATE_SCHEMA_VERSION,
-                self.author_id, suggestion_dict['change'], 'test description',
-                self.reviewer_id)
+                self.author_id, suggestion_dict['change'], 'test description')
 
         def _mock_get_suggestion_by_id(unused_suggestion_id):
             """Mocks get_suggestion_by_id()."""
@@ -1259,8 +1252,7 @@ def test_yield_validation_error_after_migration(self):
                 suggestion_models.SUGGESTION_TYPE_ADD_QUESTION,
                 suggestion_models.TARGET_TYPE_SKILL,
                 'skill1', feconf.CURRENT_STATE_SCHEMA_VERSION,
-                self.author_id, suggestion_dict['change'], 'test description',
-                self.reviewer_id)
+                self.author_id, suggestion_dict['change'], 'test description')
 
         def _mock_convert_html_in_suggestion_change(
                 unused_self, unused_conversion_fn):
diff --git a/core/domain/suggestion_registry_test.py b/core/domain/suggestion_registry_test.py
--- a/core/domain/suggestion_registry_test.py
+++ b/core/domain/suggestion_registry_test.py
@@ -287,6 +287,23 @@ def test_validate_author_id(self):
             Exception, 'Expected author_id to be a string'):
             suggestion.validate()
 
+    def test_validate_author_id_format(self):
+        expected_suggestion_dict = self.suggestion_dict
+        suggestion = suggestion_registry.SuggestionEditStateContent(
+            expected_suggestion_dict['suggestion_id'],
+            expected_suggestion_dict['target_id'],
+            expected_suggestion_dict['target_version_at_submission'],
+            expected_suggestion_dict['status'], self.author_id,
+            self.reviewer_id, expected_suggestion_dict['change'],
+            expected_suggestion_dict['score_category'], self.fake_date)
+
+        suggestion.validate()
+
+        suggestion.author_id = ''
+        with self.assertRaisesRegexp(
+            Exception, 'Expected author_id to be in a valid user ID format'):
+            suggestion.validate()
+
     def test_validate_final_reviewer_id(self):
         expected_suggestion_dict = self.suggestion_dict
         suggestion = suggestion_registry.SuggestionEditStateContent(
@@ -304,6 +321,24 @@ def test_validate_final_reviewer_id(self):
             Exception, 'Expected final_reviewer_id to be a string'):
             suggestion.validate()
 
+    def test_validate_final_reviewer_id_format(self):
+        expected_suggestion_dict = self.suggestion_dict
+        suggestion = suggestion_registry.SuggestionEditStateContent(
+            expected_suggestion_dict['suggestion_id'],
+            expected_suggestion_dict['target_id'],
+            expected_suggestion_dict['target_version_at_submission'],
+            expected_suggestion_dict['status'], self.author_id,
+            self.reviewer_id, expected_suggestion_dict['change'],
+            expected_suggestion_dict['score_category'], self.fake_date)
+
+        suggestion.validate()
+
+        suggestion.final_reviewer_id = ''
+        with self.assertRaisesRegexp(
+            Exception,
+            'Expected final_reviewer_id to be in a valid user ID format'):
+            suggestion.validate()
+
     def test_validate_score_category(self):
         expected_suggestion_dict = self.suggestion_dict
         suggestion = suggestion_registry.SuggestionEditStateContent(
@@ -830,6 +865,24 @@ def test_validate_author_id(self):
             Exception, 'Expected author_id to be a string'):
             suggestion.validate()
 
+    def test_validate_author_id_format(self):
+        expected_suggestion_dict = self.suggestion_dict
+        suggestion = suggestion_registry.SuggestionTranslateContent(
+            expected_suggestion_dict['suggestion_id'],
+            expected_suggestion_dict['target_id'],
+            expected_suggestion_dict['target_version_at_submission'],
+            expected_suggestion_dict['status'], self.author_id,
+            self.reviewer_id, expected_suggestion_dict['change'],
+            expected_suggestion_dict['score_category'], self.fake_date)
+
+        suggestion.validate()
+
+        suggestion.author_id = ''
+        with self.assertRaisesRegexp(
+            Exception,
+            'Expected author_id to be in a valid user ID format.'):
+            suggestion.validate()
+
     def test_validate_final_reviewer_id(self):
         expected_suggestion_dict = self.suggestion_dict
         suggestion = suggestion_registry.SuggestionTranslateContent(
@@ -847,6 +900,24 @@ def test_validate_final_reviewer_id(self):
             Exception, 'Expected final_reviewer_id to be a string'):
             suggestion.validate()
 
+    def test_validate_final_reviewer_id_format(self):
+        expected_suggestion_dict = self.suggestion_dict
+        suggestion = suggestion_registry.SuggestionTranslateContent(
+            expected_suggestion_dict['suggestion_id'],
+            expected_suggestion_dict['target_id'],
+            expected_suggestion_dict['target_version_at_submission'],
+            expected_suggestion_dict['status'], self.author_id,
+            self.reviewer_id, expected_suggestion_dict['change'],
+            expected_suggestion_dict['score_category'], self.fake_date)
+
+        suggestion.validate()
+
+        suggestion.final_reviewer_id = ''
+        with self.assertRaisesRegexp(
+            Exception,
+            'Expected final_reviewer_id to be in a valid user ID format.'):
+            suggestion.validate()
+
     def test_validate_score_category(self):
         expected_suggestion_dict = self.suggestion_dict
         suggestion = suggestion_registry.SuggestionTranslateContent(
@@ -1560,6 +1631,76 @@ def test_pre_update_validate_change_question_dict(self):
             suggestion.pre_update_validate(
                 question_domain.QuestionSuggestionChange(change))
 
+    def test_validate_author_id(self):
+        expected_suggestion_dict = self.suggestion_dict
+        suggestion = suggestion_registry.SuggestionAddQuestion(
+            expected_suggestion_dict['suggestion_id'],
+            expected_suggestion_dict['target_id'],
+            expected_suggestion_dict['target_version_at_submission'],
+            expected_suggestion_dict['status'], self.author_id,
+            self.reviewer_id, expected_suggestion_dict['change'],
+            expected_suggestion_dict['score_category'], self.fake_date)
+
+        suggestion.validate()
+
+        suggestion.author_id = 0
+        with self.assertRaisesRegexp(
+            Exception, 'Expected author_id to be a string'):
+            suggestion.validate()
+
+    def test_validate_author_id_format(self):
+        expected_suggestion_dict = self.suggestion_dict
+        suggestion = suggestion_registry.SuggestionAddQuestion(
+            expected_suggestion_dict['suggestion_id'],
+            expected_suggestion_dict['target_id'],
+            expected_suggestion_dict['target_version_at_submission'],
+            expected_suggestion_dict['status'], self.author_id,
+            self.reviewer_id, expected_suggestion_dict['change'],
+            expected_suggestion_dict['score_category'], self.fake_date)
+
+        suggestion.validate()
+
+        suggestion.author_id = ''
+        with self.assertRaisesRegexp(
+            Exception,
+            'Expected author_id to be in a valid user ID format.'):
+            suggestion.validate()
+
+    def test_validate_final_reviewer_id(self):
+        expected_suggestion_dict = self.suggestion_dict
+        suggestion = suggestion_registry.SuggestionAddQuestion(
+            expected_suggestion_dict['suggestion_id'],
+            expected_suggestion_dict['target_id'],
+            expected_suggestion_dict['target_version_at_submission'],
+            expected_suggestion_dict['status'], self.author_id,
+            self.reviewer_id, expected_suggestion_dict['change'],
+            expected_suggestion_dict['score_category'], self.fake_date)
+
+        suggestion.validate()
+
+        suggestion.final_reviewer_id = 1
+        with self.assertRaisesRegexp(
+            Exception, 'Expected final_reviewer_id to be a string'):
+            suggestion.validate()
+
+    def test_validate_final_reviewer_id_format(self):
+        expected_suggestion_dict = self.suggestion_dict
+        suggestion = suggestion_registry.SuggestionAddQuestion(
+            expected_suggestion_dict['suggestion_id'],
+            expected_suggestion_dict['target_id'],
+            expected_suggestion_dict['target_version_at_submission'],
+            expected_suggestion_dict['status'], self.author_id,
+            self.reviewer_id, expected_suggestion_dict['change'],
+            expected_suggestion_dict['score_category'], self.fake_date)
+
+        suggestion.validate()
+
+        suggestion.final_reviewer_id = ''
+        with self.assertRaisesRegexp(
+            Exception,
+            'Expected final_reviewer_id to be in a valid user ID format.'):
+            suggestion.validate()
+
     def test_get_all_html_content_strings(self):
         suggestion = suggestion_registry.SuggestionAddQuestion(
             self.suggestion_dict['suggestion_id'],
diff --git a/core/domain/suggestion_services_test.py b/core/domain/suggestion_services_test.py
--- a/core/domain/suggestion_services_test.py
+++ b/core/domain/suggestion_services_test.py
@@ -119,7 +119,6 @@ def test_create_new_suggestion_successfully(self):
             'target_version_at_submission': self.target_version_at_submission,
             'status': suggestion_models.STATUS_IN_REVIEW,
             'author_name': 'author',
-            'final_reviewer_id': self.reviewer_id,
             'change': {
                 'cmd': exp_domain.CMD_EDIT_STATE_PROPERTY,
                 'property_name': exp_domain.STATE_PROPERTY_CONTENT,
@@ -142,8 +141,7 @@ def test_create_new_suggestion_successfully(self):
                     suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                     suggestion_models.TARGET_TYPE_EXPLORATION,
                     self.target_id, self.target_version_at_submission,
-                    self.author_id, self.change, 'test description',
-                    self.reviewer_id)
+                    self.author_id, self.change, 'test description')
 
             observed_suggestion = suggestion_services.get_suggestion_by_id(
                 self.suggestion_id)
@@ -156,8 +154,16 @@ def test_cannot_create_suggestion_with_invalid_suggestion_type(self):
                 'invalid_suggestion_type',
                 suggestion_models.TARGET_TYPE_EXPLORATION,
                 self.target_id, self.target_version_at_submission,
-                self.author_id, self.change, 'test description',
-                self.reviewer_id)
+                self.author_id, self.change, 'test description')
+
+    def test_cannot_create_suggestion_with_invalid_author_id(self):
+        with self.assertRaisesRegexp(
+            Exception, 'Expected author_id to be in a valid user ID format'):
+            suggestion_services.create_suggestion(
+                suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
+                suggestion_models.TARGET_TYPE_EXPLORATION,
+                self.target_id, self.target_version_at_submission,
+                'invalid author ID', self.change, 'test description')
 
     def test_cannot_create_translation_suggestion_with_invalid_content_html_raise_error(self): # pylint: disable=line-too-long
         add_translation_change_dict = {
@@ -176,16 +182,14 @@ def test_cannot_create_translation_suggestion_with_invalid_content_html_raise_er
                 suggestion_models.SUGGESTION_TYPE_TRANSLATE_CONTENT,
                 suggestion_models.TARGET_TYPE_EXPLORATION,
                 self.target_id, self.target_version_at_submission,
-                self.author_id, add_translation_change_dict, 'test description',
-                self.reviewer_id)
+                self.author_id, add_translation_change_dict, 'test description')
 
     def test_get_all_stale_suggestions(self):
         suggestion_services.create_suggestion(
             suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
             suggestion_models.TARGET_TYPE_EXPLORATION,
             self.target_id, self.target_version_at_submission,
-            self.author_id, self.change, 'test description',
-            self.reviewer_id)
+            self.author_id, self.change, 'test description')
 
         with self.swap(
             suggestion_models, 'THRESHOLD_TIME_BEFORE_ACCEPT_IN_MSECS', 0):
@@ -203,8 +207,7 @@ def test_cannot_mark_review_completed_with_invalid_status(self):
             suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
             suggestion_models.TARGET_TYPE_EXPLORATION,
             self.target_id, self.target_version_at_submission,
-            self.author_id, self.change, 'test description',
-            self.reviewer_id)
+            self.author_id, self.change, 'test description')
 
         suggestion = suggestion_services.query_suggestions(
             [('author_id', self.author_id), (
@@ -228,8 +231,7 @@ def test_cannot_reject_suggestion_with_empty_review_message(self):
             suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
             suggestion_models.TARGET_TYPE_EXPLORATION,
             self.target_id, self.target_version_at_submission,
-            self.author_id, self.change, 'test description',
-            self.reviewer_id)
+            self.author_id, self.change, 'test description')
 
         suggestion = suggestion_services.query_suggestions(
             [('author_id', self.author_id), (
@@ -245,8 +247,7 @@ def test_email_is_not_sent_to_unregistered_user(self):
             suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
             suggestion_models.TARGET_TYPE_EXPLORATION,
             self.target_id, self.target_version_at_submission,
-            self.author_id, self.change, 'test description',
-            self.reviewer_id)
+            self.author_id, self.change, 'test description')
 
         suggestion = suggestion_services.query_suggestions(
             [('author_id', self.author_id), (
@@ -262,8 +263,7 @@ def test_cannot_mark_email_has_been_sent_to_user_with_no_user_scoring_model(
             suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
             suggestion_models.TARGET_TYPE_EXPLORATION,
             self.target_id, self.target_version_at_submission,
-            self.author_id, self.change, 'test description',
-            self.reviewer_id)
+            self.author_id, self.change, 'test description')
 
         suggestion = suggestion_services.query_suggestions(
             [('author_id', self.author_id), (
@@ -300,8 +300,7 @@ def test_accept_suggestion_and_send_email_to_author(self):
             suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
             suggestion_models.TARGET_TYPE_EXPLORATION,
             self.target_id, self.target_version_at_submission,
-            self.author_id, change_dict, 'test description',
-            self.reviewer_id)
+            self.author_id, change_dict, 'test description')
 
         suggestion = suggestion_services.query_suggestions(
             [('author_id', self.author_id), (
@@ -342,8 +341,7 @@ def test_accept_suggestion_successfully(self):
                     suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                     suggestion_models.TARGET_TYPE_EXPLORATION,
                     self.target_id, self.target_version_at_submission,
-                    self.author_id, self.change, 'test description',
-                    self.reviewer_id)
+                    self.author_id, self.change, 'test description')
 
         suggestion = suggestion_services.get_suggestion_by_id(
             self.suggestion_id)
@@ -400,8 +398,7 @@ def test_accept_suggestion_with_invalid_math_fails(self):
                     suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                     suggestion_models.TARGET_TYPE_EXPLORATION,
                     self.target_id, self.target_version_at_submission,
-                    self.author_id, change_dict, 'test description',
-                    self.reviewer_id)
+                    self.author_id, change_dict, 'test description')
 
         suggestion = suggestion_services.get_suggestion_by_id(
             self.suggestion_id)
@@ -438,8 +435,7 @@ def test_accept_suggestion_handled_suggestion_failure(self):
                     suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                     suggestion_models.TARGET_TYPE_EXPLORATION,
                     self.target_id, self.target_version_at_submission,
-                    self.author_id, self.change, 'test description',
-                    self.reviewer_id)
+                    self.author_id, self.change, 'test description')
 
         suggestion = suggestion_services.get_suggestion_by_id(
             self.suggestion_id)
@@ -480,8 +476,7 @@ def test_accept_suggestion_invalid_suggestion_failure(self):
                     suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                     suggestion_models.TARGET_TYPE_EXPLORATION,
                     self.target_id, self.target_version_at_submission,
-                    self.author_id, self.change, 'test description',
-                    self.reviewer_id)
+                    self.author_id, self.change, 'test description')
         suggestion = suggestion_services.get_suggestion_by_id(
             self.suggestion_id)
 
@@ -507,8 +502,7 @@ def test_accept_suggestion_no_commit_message_failure(self):
                     suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                     suggestion_models.TARGET_TYPE_EXPLORATION,
                     self.target_id, self.target_version_at_submission,
-                    self.author_id, self.change, 'test description',
-                    self.reviewer_id)
+                    self.author_id, self.change, 'test description')
         suggestion = suggestion_services.get_suggestion_by_id(
             self.suggestion_id)
 
@@ -528,8 +522,7 @@ def test_reject_suggestion_successfully(self):
                     suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                     suggestion_models.TARGET_TYPE_EXPLORATION,
                     self.target_id, self.target_version_at_submission,
-                    self.author_id, self.change, 'test description',
-                    self.reviewer_id)
+                    self.author_id, self.change, 'test description')
 
         suggestion = suggestion_services.get_suggestion_by_id(
             self.suggestion_id)
@@ -557,8 +550,7 @@ def test_reject_suggestion_handled_suggestion_failure(self):
                     suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                     suggestion_models.TARGET_TYPE_EXPLORATION,
                     self.target_id, self.target_version_at_submission,
-                    self.author_id, self.change, 'test description',
-                    self.reviewer_id)
+                    self.author_id, self.change, 'test description')
         suggestion = suggestion_services.get_suggestion_by_id(
             self.suggestion_id)
 
@@ -599,8 +591,7 @@ def test_resubmit_rejected_suggestion_success(self):
                     suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                     suggestion_models.TARGET_TYPE_EXPLORATION,
                     self.target_id, self.target_version_at_submission,
-                    self.author_id, self.change, 'test description',
-                    self.reviewer_id)
+                    self.author_id, self.change, 'test description')
         suggestion = suggestion_services.get_suggestion_by_id(
             self.suggestion_id)
         suggestion_services.reject_suggestion(
@@ -623,8 +614,7 @@ def test_resubmit_rejected_suggestion_failure(self):
                     suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                     suggestion_models.TARGET_TYPE_EXPLORATION,
                     self.target_id, self.target_version_at_submission,
-                    self.author_id, self.change, 'test description',
-                    self.reviewer_id)
+                    self.author_id, self.change, 'test description')
         suggestion = suggestion_services.get_suggestion_by_id(
             self.suggestion_id)
         with self.assertRaisesRegexp(
@@ -647,8 +637,7 @@ def test_resubmit_accepted_suggestion_failure(self):
                     suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                     suggestion_models.TARGET_TYPE_EXPLORATION,
                     self.target_id, self.target_version_at_submission,
-                    self.author_id, self.change, 'test description',
-                    self.reviewer_id)
+                    self.author_id, self.change, 'test description')
                 suggestion = suggestion_services.get_suggestion_by_id(
                     self.suggestion_id)
                 with self.swap(
@@ -677,8 +666,7 @@ def test_check_can_resubmit_suggestion(self):
                     suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                     suggestion_models.TARGET_TYPE_EXPLORATION,
                     self.target_id, self.target_version_at_submission,
-                    self.author_id, self.change, 'test description',
-                    self.reviewer_id)
+                    self.author_id, self.change, 'test description')
         can_resubmit = suggestion_services.check_can_resubmit_suggestion(
             self.suggestion_id, self.author_id)
         self.assertEqual(can_resubmit, True)
@@ -749,34 +737,31 @@ def setUp(self):
                 suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                 suggestion_models.TARGET_TYPE_EXPLORATION,
                 self.target_id_1, self.target_version_at_submission,
-                self.author_id_1, self.change, 'test description',
-                self.reviewer_id_1)
+                self.author_id_1, self.change, 'test description')
 
             suggestion_services.create_suggestion(
                 suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                 suggestion_models.TARGET_TYPE_EXPLORATION,
                 self.target_id_1, self.target_version_at_submission,
-                self.author_id_1, self.change, 'test description', None)
+                self.author_id_1, self.change, 'test description')
 
             suggestion_services.create_suggestion(
                 suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                 suggestion_models.TARGET_TYPE_EXPLORATION,
                 self.target_id_1, self.target_version_at_submission,
-                self.author_id_1, self.change, 'test description', None)
+                self.author_id_1, self.change, 'test description')
 
             suggestion_services.create_suggestion(
                 suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                 suggestion_models.TARGET_TYPE_EXPLORATION,
                 self.target_id_1, self.target_version_at_submission,
-                self.author_id_2, self.change, 'test description',
-                self.reviewer_id_2)
+                self.author_id_2, self.change, 'test description')
 
             suggestion_services.create_suggestion(
                 suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                 suggestion_models.TARGET_TYPE_EXPLORATION,
                 self.target_id_2, self.target_version_at_submission,
-                self.author_id_2, self.change, 'test description',
-                self.reviewer_id_2)
+                self.author_id_2, self.change, 'test description')
 
     def test_get_by_author(self):
         queries = [('author_id', self.author_id_1)]
@@ -784,12 +769,6 @@ def test_get_by_author(self):
         queries = [('author_id', self.author_id_2)]
         self.assertEqual(len(suggestion_services.query_suggestions(queries)), 2)
 
-    def test_get_by_reviewer(self):
-        queries = [('final_reviewer_id', self.reviewer_id_1)]
-        self.assertEqual(len(suggestion_services.query_suggestions(queries)), 1)
-        queries = [('final_reviewer_id', self.reviewer_id_2)]
-        self.assertEqual(len(suggestion_services.query_suggestions(queries)), 2)
-
     def test_get_by_target_id(self):
         queries = [
             ('target_type', suggestion_models.TARGET_TYPE_EXPLORATION),
@@ -966,7 +945,7 @@ def test_create_and_accept_suggestion(self):
                 suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                 suggestion_models.TARGET_TYPE_EXPLORATION,
                 self.EXP_ID, self.target_version_at_submission,
-                self.author_id, self.change, 'test description', None)
+                self.author_id, self.change, 'test description')
 
         suggestion_id = self.THREAD_ID
         suggestion = suggestion_services.get_suggestion_by_id(suggestion_id)
@@ -990,7 +969,7 @@ def test_create_and_reject_suggestion(self):
                 suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                 suggestion_models.TARGET_TYPE_EXPLORATION,
                 self.EXP_ID, self.target_version_at_submission,
-                self.author_id, self.change, 'test description', None)
+                self.author_id, self.change, 'test description')
 
         suggestion_id = self.THREAD_ID
         suggestion = suggestion_services.get_suggestion_by_id(suggestion_id)
@@ -1017,7 +996,7 @@ def test_create_and_accept_suggestion_with_message(self):
                 suggestion_models.SUGGESTION_TYPE_EDIT_STATE_CONTENT,
                 suggestion_models.TARGET_TYPE_EXPLORATION,
                 self.EXP_ID, self.target_version_at_submission,
-                self.author_id, self.change, 'test description', None)
+                self.author_id, self.change, 'test description')
 
         suggestion_id = self.THREAD_ID
         suggestion = suggestion_services.get_suggestion_by_id(suggestion_id)
diff --git a/core/tests/test_utils.py b/core/tests/test_utils.py
--- a/core/tests/test_utils.py
+++ b/core/tests/test_utils.py
@@ -1121,7 +1121,7 @@ def save_new_default_exploration(
             Exploration. The exploration domain object.
         """
         exploration = exp_domain.Exploration.create_default_exploration(
-            exploration_id, title=title, category='A category')
+            exploration_id, title=title, category='Algebra')
         exp_services.save_new_exploration(owner_id, exploration)
         return exploration