Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

work in progress

  • Loading branch information...
commit f7b645005e8db5529baed40dfb149400e5334c1c 1 parent afaf6c7
@mattupstate authored
Showing with 24 additions and 24 deletions.
  1. +24 −24 tests/configured_tests.py
View
48 tests/configured_tests.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from __future__ import with_statement
+# from __future__ import with_statement
import base64
import time
@@ -16,18 +16,18 @@
from tests import SecurityTest
+# TODO: Wait for passlib + bcrypt python3 compatibility to be fixed
+# class ConfiguredPasswordHashSecurityTests(SecurityTest):
-class ConfiguredPasswordHashSecurityTests(SecurityTest):
+# AUTH_CONFIG = {
+# 'SECURITY_PASSWORD_HASH': 'bcrypt',
+# 'SECURITY_PASSWORD_SALT': 'so-salty',
+# 'USER_COUNT': 1
+# }
- AUTH_CONFIG = {
- 'SECURITY_PASSWORD_HASH': 'bcrypt',
- 'SECURITY_PASSWORD_SALT': 'so-salty',
- 'USER_COUNT': 1
- }
-
- def test_authenticate(self):
- r = self.authenticate(endpoint="/login")
- self.assertIn(b'Home Page', r.data)
+# def test_authenticate(self):
+# r = self.authenticate(endpoint="/login")
+# self.assertIn(b'Home Page', r.data)
class ConfiguredSecurityTests(SecurityTest):
@@ -45,7 +45,7 @@ class ConfiguredSecurityTests(SecurityTest):
def test_login_view(self):
r = self._get('/custom_login')
- self.assertIn("<h1>Login</h1>", r.data)
+ self.assertIn(b"<h1>Login</h1>", r.data)
def test_authenticate(self):
r = self.authenticate(endpoint="/custom_login")
@@ -87,13 +87,13 @@ def test_register_existing_email(self):
password='password',
password_confirm='password')
r = self._post('/register', data=data, follow_redirects=True)
- msg = 'matt@lp.com is already associated with an account'
+ msg = b'matt@lp.com is already associated with an account'
self.assertIn(msg, r.data)
def test_unauthorized(self):
self.authenticate("joe@lp.com", endpoint="/custom_auth")
r = self._get("/admin", follow_redirects=True)
- msg = 'You are not allowed to access the requested resouce'
+ msg = b'You are not allowed to access the requested resouce'
self.assertIn(msg, r.data)
def test_default_http_auth_realm(self):
@@ -221,7 +221,7 @@ def test_send_confirmation_of_already_confirmed_account(self):
e = 'dude@lp.com'
with capture_registrations() as registrations:
- self.register(e)
+ r = self.register(e)
token = registrations[0]['confirm_token']
self.client.get('/confirm/' + token, follow_redirects=True)
@@ -241,7 +241,7 @@ def test_confirm_email(self):
e = 'dude@lp.com'
with capture_registrations() as registrations:
- self.register(e)
+ r = self.register(e)
token = registrations[0]['confirm_token']
r = self.client.get('/confirm/' + token, follow_redirects=True)
@@ -393,7 +393,7 @@ def test_forgot_password_json(self):
def test_forgot_password_invalid_email(self):
r = self._post('/reset', data=dict(email='larry@lp.com'),
follow_redirects=True)
- self.assertIn("Specified user does not exist", r.data)
+ self.assertIn(b"Specified user does not exist", r.data)
def test_reset_password_with_valid_token(self):
with capture_reset_password_requests() as requests:
@@ -755,11 +755,11 @@ class MyRegisterForm(RegisterForm):
def test_login_view(self):
r = self._get('/login', follow_redirects=True)
- self.assertIn("My Login Email Address Field", r.data)
+ self.assertIn(b"My Login Email Address Field", r.data)
def test_register(self):
r = self._get('/register', follow_redirects=True)
- self.assertIn("My Register Email Address Field", r.data)
+ self.assertIn(b"My Register Email Address Field", r.data)
class RecoverableExtendFormsTest(SecurityTest):
@@ -782,7 +782,7 @@ class MyResetPasswordForm(ResetPasswordForm):
def test_forgot_password(self):
r = self._get('/reset', follow_redirects=True)
- self.assertIn("My Forgot Password Email Address Field", r.data)
+ self.assertIn(b"My Forgot Password Email Address Field", r.data)
def test_reset_password(self):
with capture_reset_password_requests() as requests:
@@ -790,7 +790,7 @@ def test_reset_password(self):
follow_redirects=True)
token = requests[0]['token']
r = self._get('/reset/' + token)
- self.assertIn("My Reset Password Submit Field", r.data)
+ self.assertIn(b"My Reset Password Submit Field", r.data)
class PasswordlessExtendFormsTest(SecurityTest):
@@ -808,7 +808,7 @@ class MyPasswordlessLoginForm(PasswordlessLoginForm):
def test_passwordless_login(self):
r = self._get('/login', follow_redirects=True)
- self.assertIn("My Passwordless Login Email Address Field", r.data)
+ self.assertIn(b"My Passwordless Login Email Address Field", r.data)
class ConfirmableExtendFormsTest(SecurityTest):
@@ -831,11 +831,11 @@ class MySendConfirmationForm(SendConfirmationForm):
def test_register(self):
r = self._get('/register', follow_redirects=True)
- self.assertIn("My Confirm Register Email Address Field", r.data)
+ self.assertIn(b"My Confirm Register Email Address Field", r.data)
def test_send_confirmation(self):
r = self._get('/confirm', follow_redirects=True)
- self.assertIn("My Send Confirmation Email Address Field", r.data)
+ self.assertIn(b"My Send Confirmation Email Address Field", r.data)
class AdditionalUserIdentityAttributes(SecurityTest):
Please sign in to comment.
Something went wrong with that request. Please try again.