We need to use an Open edX footer by default (and that's what all non-edx.org instances should base their footer off) and only use the edX footer on edx.org. This commit uses `SITE_NAME` to determine which footer to use. Sites using theming or micro-sites with a `SITE_NAME` not ending in `edx.org` should not be affected.
36 lines
1.1 KiB
Python
36 lines
1.1 KiB
Python
"""
|
|
Tests related to the basic footer-switching based off SITE_NAME to ensure
|
|
edx.org uses an edx footer but other instances use an Open edX footer.
|
|
"""
|
|
|
|
from django.test import TestCase
|
|
from django.test.utils import override_settings
|
|
|
|
|
|
class TestFooter(TestCase):
|
|
|
|
@override_settings(SITE_NAME="edx.org")
|
|
def test_edx_footer(self):
|
|
"""
|
|
Verify that the homepage, when accessed at edx.org, has the edX footer
|
|
"""
|
|
|
|
resp = self.client.get('/')
|
|
self.assertEqual(resp.status_code, 200)
|
|
|
|
# assert that footer template has been properly overriden on homepage
|
|
self.assertContains(resp, 'EdX is a non-profit created by founding partners Harvard and MIT')
|
|
|
|
@override_settings(SITE_NAME="example.com")
|
|
def test_openedx_footer(self):
|
|
"""
|
|
Verify that the homepage, when accessed at something other than
|
|
edx.org, has the Open edX footer
|
|
"""
|
|
|
|
resp = self.client.get('/')
|
|
self.assertEqual(resp.status_code, 200)
|
|
|
|
# assert that footer template has been properly overriden on homepage
|
|
self.assertContains(resp, 'Powered by Open edX')
|