Repository: ocadotechnology/codeforlife-portal

Issue:
Code For Life logo to be updated in Pupil Certificates
Also, we should have a different PDF for colour and black & white


Discussion:

Resolving patch:
diff --git a/portal/urls.py b/portal/urls.py
--- a/portal/urls.py
+++ b/portal/urls.py
@@ -237,6 +237,7 @@
     url(r'^redesign/about', TemplateView.as_view(template_name='redesign/about_new.html'), name='about_new'),
     url(r'^redesign/help/$', contact_new, name='help_new'),
     url(r'^redesign/terms', TemplateView.as_view(template_name='redesign/terms_new.html'), name='terms_new'),
+    url(r'^redesign/teach/resources/$', TemplateView.as_view(template_name='redesign/teach_new/teacher_resources.html'), name='teaching_resources'),
     url(r'^redesign/teach/materials/$', TemplateView.as_view(template_name='redesign/teach_new/materials_new.html'), name='materials_new'),
     url(r'^redesign/teach/materials/(?P<pdf_name>[a-zA-Z0-9\/\-_]+)$', materials_viewer_new, name='materials_viewer_new'),
     url(r'^redesign/teach/dashboard/$', dashboard_manage, name='dashboard'),


Test patch:
diff --git a/portal/tests/pageObjects/portal/materials_page.py b/portal/tests/pageObjects/portal/materials_page.py
new file mode 100644
--- /dev/null
+++ b/portal/tests/pageObjects/portal/materials_page.py
@@ -0,0 +1,49 @@
+# -*- coding: utf-8 -*-
+# Code for Life
+#
+# Copyright (C) 2017, Ocado Innovation Limited
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# ADDITIONAL TERMS – Section 7 GNU General Public Licence
+#
+# This licence does not grant any right, title or interest in any “Ocado” logos,
+# trade names or the trademark “Ocado” or any other trademarks or domain names
+# owned by Ocado Innovation Limited or the Ocado group of companies or any other
+# distinctive brand features of “Ocado” as may be secured from time to time. You
+# must not distribute any modification of this program using the trademark
+# “Ocado” or claim any affiliation or association with Ocado or its employees.
+#
+# You are not authorised to use the name Ocado (or any of its trade names) or
+# the names of any author or contributor in advertising or for publicity purposes
+# pertaining to the distribution of this program, without the prior written
+# authorisation of Ocado.
+#
+# Any propagation, distribution or conveyance of this program must include this
+# copyright notice and these terms. You must not misrepresent the origins of this
+# program; modified versions of the program must be marked as such and not
+# identified as the original program.
+from base_page import BasePage
+import pdf_viewer_page
+
+
+class MaterialsPage(BasePage):
+    def __init__(self, browser):
+        super(MaterialsPage, self).__init__(browser)
+
+        assert self.on_correct_page('materials_page')
+
+    def click_pdf_link(self):
+        self.browser.find_element_by_id('pdf_link').click()
+        return pdf_viewer_page.PDFViewerPage(self.browser)
diff --git a/portal/tests/pageObjects/portal/pdf_viewer_page.py b/portal/tests/pageObjects/portal/pdf_viewer_page.py
--- a/portal/tests/pageObjects/portal/pdf_viewer_page.py
+++ b/portal/tests/pageObjects/portal/pdf_viewer_page.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 # Code for Life
 #
-# Copyright (C) 2016, Ocado Innovation Limited
+# Copyright (C) 2017, Ocado Innovation Limited
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU Affero General Public License as
diff --git a/portal/tests/pageObjects/portal/resources_page.py b/portal/tests/pageObjects/portal/resources_page.py
--- a/portal/tests/pageObjects/portal/resources_page.py
+++ b/portal/tests/pageObjects/portal/resources_page.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 # Code for Life
 #
-# Copyright (C) 2016, Ocado Innovation Limited
+# Copyright (C) 2017, Ocado Innovation Limited
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU Affero General Public License as
@@ -35,7 +35,7 @@
 # program; modified versions of the program must be marked as such and not
 # identified as the original program.
 from base_page import BasePage
-import pdf_viewer_page
+import materials_page
 
 
 class ResourcesPage(BasePage):
@@ -44,6 +44,6 @@ def __init__(self, browser):
 
         assert self.on_correct_page('resources_page')
 
-    def click_pdf_link(self):
-        self.browser.find_element_by_id('pdf_link').click()
-        return pdf_viewer_page.PDFViewerPage(self.browser)
+    def go_to_materials_page(self):
+        self.browser.find_element_by_id('materials_button').click()
+        return materials_page.MaterialsPage(self.browser)
diff --git a/portal/tests/test_teacher_new.py b/portal/tests/test_teacher_new.py
--- a/portal/tests/test_teacher_new.py
+++ b/portal/tests/test_teacher_new.py
@@ -96,9 +96,9 @@ def test_view_resources(self):
 
         assert self.is_dashboard_page(page)
 
-        page = page.go_to_resources_page()
+        page = page.go_to_resources_page().go_to_materials_page()
 
-        assert self.is_resources_page(page)
+        assert self.is_materials_page(page)
 
         page = page.click_pdf_link()
 
@@ -197,8 +197,8 @@ def wait_for_email(self):
     def is_dashboard_page(self, page):
         return page.__class__.__name__ == 'TeachDashboardPage'
 
-    def is_resources_page(self, page):
-        return page.__class__.__name__ == 'ResourcesPage'
+    def is_materials_page(self, page):
+        return page.__class__.__name__ == 'MaterialsPage'
 
     def is_pdf_viewer_page(self, page):
         return page.__class__.__name__ == 'PDFViewerPage'