@@ -0,0 +1,3129 @@
+# 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 custom landing pages.%22%22%22%0A%0Afrom core.tests import test_utils%0Aimport feconf%0A%0A%0Aclass FractionLandingPageTest(test_utils.GenericTestBase):%0A%0A    def test_fraction_landing_page_without_viewer_type(self):%0A        %22%22%22Test for showing the landing page for fractions,%0A        without any viewer type should redirect to teacher type.%0A        %22%22%22%0A        response = self.testapp.get(feconf.FRACTIONS_LANDING_PAGE_URL)%0A        self.assertEqual(response.status_int, 302)%0A        self.assertEqual(response.content_type, 'text/html')%0A        response.mustcontain('/fractions_landing/teachers')%0A%0A    def test_fraction_landing_page_with_viewer_type(self):%0A        %22%22%22Test for showing the landing page for fractions,%0A        with student viewer type should respond student type.%0A        %22%22%22%0A        response = self.testapp.get(%0A            '%25s?viewerType=student' %25 (feconf.FRACTIONS_LANDING_PAGE_URL))%0A        self.assertEqual(response.status_int, 200)%0A        self.assertEqual(response.content_type, 'text/html')%0A        response.mustcontain('/fractions_landing/student')%0A%0A%0Aclass StewardsLandingPageTest(test_utils.GenericTestBase):%0A    %22%22%22Test for showing the landing page for stewards (parents, teachers,%0A    volunteers, or NGOs).%0A    %22%22%22%0A    def test_nonprofits_landing_page(self):%0A        response = self.testapp.get(feconf.CUSTOM_NONPROFITS_LANDING_PAGE_URL)%0A        self.assertEqual(response.status_int, 200)%0A        self.assertEqual(response.content_type, 'text/html')%0A        response.mustcontain(%0A            'Let%5C's work together to make compelling educational')%0A%0A    def test_parents_landing_page(self):%0A        response = self.testapp.get(feconf.CUSTOM_PARENTS_LANDING_PAGE_URL)%0A        self.assertEqual(response.status_int, 200)%0A        self.assertEqual(response.content_type, 'text/html')%0A        response.mustcontain(%0A            'Help your child learn with our free, engaging lessons')%0A%0A    def test_teachers_landing_page(self):%0A        response = self.testapp.get(feconf.CUSTOM_TEACHERS_LANDING_PAGE_URL)%0A        self.assertEqual(response.status_int, 200)%0A        self.assertEqual(response.content_type, 'text/html')%0A        response.mustcontain('Oppia%5C's free, personalized lessons are a great')%0A%0A    def test_volunteers_landing_page(self):%0A        response = self.testapp.get(feconf.CUSTOM_VOLUNTEERS_LANDING_PAGE_URL)%0A        self.assertEqual(response.status_int, 200)%0A        self.assertEqual(response.content_type, 'text/html')%0A        response.mustcontain('Help improve access to high-quality education')%0A

Fix part of #5134: Adding tests for core.controllers.custom_landing_pages. (#5925)