From 449d52caf4010ed112f1928bf6b5234bcfb9a339 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Sun, 20 May 2018 23:29:17 +0100 Subject: Privacy/Usability updates (#75) * Use less intrusive oauth scopes, add login redirect method * Remove debugging prints, add missing __init__ * Work towards new privacy policy * Fix judging state icons on code jam management page * Jammer profile retraction and punishments based on jam status * Linting * [Jams] Deny profile saving for users < 13 years, and finish removal page * Fix tests * Clean up and address Volcyy's review * Add proper login redirection to require_roles decorator * Fix template is_staff() and add staff link to navigation * Address lemon's review * Linting * Privacy page formatting * Privacy page formatting --- tests/test_mixins.py | 4 ++-- tests/test_oauth_backend.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/test_mixins.py b/tests/test_mixins.py index 58118ae0..27e61b22 100644 --- a/tests/test_mixins.py +++ b/tests/test_mixins.py @@ -27,7 +27,7 @@ class MixinTests(SiteTest): from flask import Blueprint from pysite.route_manager import RouteView - from pysite.oauth import OauthBackend + from pysite.oauth import OAuthBackend class TestRoute(RouteView): name = "test" @@ -35,7 +35,7 @@ class MixinTests(SiteTest): tr = TestRoute() tr.setup(manager, Blueprint("test", "test_name")) - self.assertIsInstance(tr.oauth, OauthBackend) + self.assertIsInstance(tr.oauth, OAuthBackend) def test_user_data_property(self): """ Make sure the user_data property works""" diff --git a/tests/test_oauth_backend.py b/tests/test_oauth_backend.py index 58e40c25..473f5c54 100644 --- a/tests/test_oauth_backend.py +++ b/tests/test_oauth_backend.py @@ -1,6 +1,6 @@ from tests import SiteTest, manager -class TestOauthBackend(SiteTest): +class TestOAuthBackend(SiteTest): """ Test cases for the oauth.py file """ def test_get(self): @@ -23,7 +23,7 @@ class TestOauthBackend(SiteTest): sess_id = "hey bro wazup" fake_token = {"access_token": "access_token", "id": sess_id, "refresh_token": "refresh_token", "expires_at": 5} - fake_user = {"id": 1235678987654321, "username": "Zwacky", "discriminator": "#6660", "email": "z@g.co"} + fake_user = {"id": 1235678987654321, "username": "Zwacky", "discriminator": "#6660"} manager.db.conn = manager.db.get_connection() manager.oauth_backend.add_user(fake_token, fake_user, sess_id) -- cgit v1.2.3