@@ -0,0 +1,2789 @@
+# Copyright 2018 The Oppia Authors. All Rights Reserved.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A#      http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS-IS%22 BASIS,%0A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A# See the License for the specific language governing permissions and%0A# limitations under the License.%0A%0A%22%22%22Tests for Oppia story models.%22%22%22%0Aimport datetime%0A%0Afrom core.platform import models%0Afrom core.tests import test_utils%0A%0A(story_models, base_models, ) = models.Registry.import_models(%0A    %5Bmodels.NAMES.story, models.NAMES.base_model%5D)%0A%0A%0Aclass StoryModelTest(test_utils.GenericTestBase):%0A    %22%22%22Tests for Oppia story models.%22%22%22%0A    def test_story_model(self):%0A        %22%22%22Method to test the StoryModel.%22%22%22%0A%0A        committer_id = 'test_committer_id'%0A        commit_message = 'test_commit_message'%0A        commit_cmds = %5B%7B'cmd': 'test_command'%7D%5D%0A%0A        story_instance = story_models.StoryModel(%0A            id='id',%0A            title='title',%0A            description='description',%0A            notes='notes',%0A            language_code='language_code')%0A        story_instance.commit(committer_id, commit_message, commit_cmds)%0A        story_by_id = story_models.StoryModel.get_by_id('id')%0A%0A        self.assertEqual(story_by_id.description, 'description')%0A        self.assertEqual(story_by_id.id, 'id')%0A        self.assertEqual(story_by_id.notes, 'notes')%0A        self.assertEqual(story_by_id.language_code, 'language_code')%0A        self.assertEqual(story_by_id.title, 'title')%0A%0A%0Aclass StorySummaryModelTest(test_utils.GenericTestBase):%0A    %22%22%22Tests for Oppia story summary models.%22%22%22%0A%0A    def test_story_summary_model(self):%0A        %22%22%22Method to test the StorySummaryModel.%22%22%22%0A%0A        story_summary_model = story_models.StorySummaryModel(%0A            id='id',%0A            title='title',%0A            description='description',%0A            story_model_last_updated=datetime.datetime.utcnow(),%0A            story_model_created_on=datetime.datetime.utcnow(),%0A            language_code='language_code',%0A            node_count=2,%0A            version=1)%0A        story_summary_model.put()%0A        story_summary_by_id = story_models.StorySummaryModel.get_by_id('id')%0A%0A        self.assertEqual(story_summary_by_id.description, 'description')%0A        self.assertEqual(story_summary_by_id.title, 'title')%0A        self.assertEqual(story_summary_by_id.language_code, 'language_code')%0A        self.assertEqual(story_summary_by_id.node_count, 2)%0A        self.assertEqual(story_summary_by_id.version, 1)%0A

Fix part of #5134: Add tests to core_storage_story (#5644)