[Python-modules-commits] [python-django-otp] 02/09: New upstream version 0.4.2

Michael Fladischer fladi at moszumanska.debian.org
Mon Jan 8 17:52:37 UTC 2018


This is an automated email from the git hooks/post-receive script.

fladi pushed a commit to branch debian/master
in repository python-django-otp.

commit 783dc0f76150b02d7180476e2f8c548f0382ab82
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date:   Mon Jan 8 18:40:12 2018 +0100

    New upstream version 0.4.2
---
 CHANGES                                            |  6 +++++
 PKG-INFO                                           |  2 +-
 django_otp.egg-info/PKG-INFO                       |  2 +-
 django_otp/plugins/otp_email/tests.py              |  6 ++---
 django_otp/plugins/otp_hotp/tests.py               |  4 +--
 .../management/commands/addstatictoken.py          |  3 ++-
 django_otp/plugins/otp_static/tests.py             | 29 +++++++++++-----------
 docs/source/conf.py                                |  2 +-
 docs/source/overview.rst                           |  4 +--
 setup.py                                           |  2 +-
 10 files changed, 33 insertions(+), 27 deletions(-)

diff --git a/CHANGES b/CHANGES
index bc491e9..a36f063 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+v0.4.2 - December 15, 2017 - addstatictoken fix
+-----------------------------------------------
+
+- Fix addstatictoken string handling under Python 3.
+
+
 v0.4.1 - August 29, 2017 - Misc fixes
 -------------------------------------
 
diff --git a/PKG-INFO b/PKG-INFO
index 1e55e7d..35af781 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: django-otp
-Version: 0.4.1.1
+Version: 0.4.2
 Summary: A pluggable framework for adding two-factor authentication to Django using one-time passwords.
 Home-page: https://bitbucket.org/psagers/django-otp
 Author: Peter Sagerson
diff --git a/django_otp.egg-info/PKG-INFO b/django_otp.egg-info/PKG-INFO
index 1e55e7d..35af781 100644
--- a/django_otp.egg-info/PKG-INFO
+++ b/django_otp.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: django-otp
-Version: 0.4.1.1
+Version: 0.4.2
 Summary: A pluggable framework for adding two-factor authentication to Django using one-time passwords.
 Home-page: https://bitbucket.org/psagers/django-otp
 Author: Peter Sagerson
diff --git a/django_otp/plugins/otp_email/tests.py b/django_otp/plugins/otp_email/tests.py
index 7cb6b45..28ecf8e 100644
--- a/django_otp/plugins/otp_email/tests.py
+++ b/django_otp/plugins/otp_email/tests.py
@@ -37,8 +37,8 @@ class AuthFormTest(TestCase):
 
         self.assertFalse(form.is_valid())
         alice = form.get_user()
-        self.assertTrue(alice.get_username() == 'alice')
-        self.assertTrue(alice.otp_device is None)
+        self.assertEqual(alice.get_username(), 'alice')
+        self.assertIsNone(alice.otp_device)
         self.assertEqual(len(mail.outbox), 1)
 
         data['otp_token'] = mail.outbox[0].body
@@ -46,4 +46,4 @@ class AuthFormTest(TestCase):
         form = OTPAuthenticationForm(None, data)
 
         self.assertTrue(form.is_valid())
-        self.assertTrue(isinstance(form.get_user().otp_device, EmailDevice))
+        self.assertIsInstance(form.get_user().otp_device, EmailDevice)
diff --git a/django_otp/plugins/otp_hotp/tests.py b/django_otp/plugins/otp_hotp/tests.py
index 45e5e93..413c6a8 100644
--- a/django_otp/plugins/otp_hotp/tests.py
+++ b/django_otp/plugins/otp_hotp/tests.py
@@ -37,13 +37,13 @@ class HOTPTest(TestCase):
     def test_excessive_drift(self):
         ok = self.device.verify_token(self.tokens[2])
 
-        self.assertTrue(not ok)
+        self.assertFalse(ok)
         self.assertEqual(self.device.counter, 0)
 
     def test_bad_value(self):
         ok = self.device.verify_token(123456)
 
-        self.assertTrue(not ok)
+        self.assertFalse(ok)
         self.assertEqual(self.device.counter, 0)
 
     def test_config_url_no_issuer(self):
diff --git a/django_otp/plugins/otp_static/management/commands/addstatictoken.py b/django_otp/plugins/otp_static/management/commands/addstatictoken.py
index 817bcac..07246cd 100644
--- a/django_otp/plugins/otp_static/management/commands/addstatictoken.py
+++ b/django_otp/plugins/otp_static/management/commands/addstatictoken.py
@@ -4,6 +4,7 @@ from optparse import make_option
 from textwrap import fill
 
 from django.core.management.base import BaseCommand, CommandError
+from django.utils.encoding import force_text
 
 from django_otp.plugins.otp_static.lib import get_user_model, add_static_token
 
@@ -25,4 +26,4 @@ class Command(BaseCommand):
         except get_user_model().DoesNotExist:
             raise CommandError('User "{0}" does not exist.'.format(username))
 
-        self.stdout.write(statictoken.token)
+        self.stdout.write(force_text(statictoken.token))
diff --git a/django_otp/plugins/otp_static/tests.py b/django_otp/plugins/otp_static/tests.py
index 4ff5cf8..9c4a930 100644
--- a/django_otp/plugins/otp_static/tests.py
+++ b/django_otp/plugins/otp_static/tests.py
@@ -85,7 +85,7 @@ class AuthFormTest(TestCase):
         data = {}
         form = OTPAuthenticationForm(None, data)
 
-        self.assertTrue(not form.is_valid())
+        self.assertFalse(form.is_valid())
         self.assertEqual(form.get_user(), None)
 
     def test_bad_password(self):
@@ -95,8 +95,7 @@ class AuthFormTest(TestCase):
         }
         form = OTPAuthenticationForm(None, data)
 
-        self.assertTrue(not form.is_valid())
-        self.assertTrue(form.get_user() is None)
+        self.assertFalse(form.is_valid())
         self.assertEqual(list(form.errors.keys()), ['__all__'])
 
     def test_no_token(self):
@@ -106,8 +105,8 @@ class AuthFormTest(TestCase):
         }
         form = OTPAuthenticationForm(None, data)
 
-        self.assertTrue(not form.is_valid())
-        self.assertTrue(form.get_user().get_username() == 'alice')
+        self.assertFalse(form.is_valid())
+        self.assertEqual(form.get_user().get_username(), 'alice')
 
     def test_passive_token(self):
         data = {
@@ -119,8 +118,8 @@ class AuthFormTest(TestCase):
 
         self.assertTrue(form.is_valid())
         alice = form.get_user()
-        self.assertTrue(alice.get_username() == 'alice')
-        self.assertTrue(isinstance(alice.otp_device, StaticDevice))
+        self.assertEqual(alice.get_username(), 'alice')
+        self.assertIsInstance(alice.otp_device, StaticDevice)
         self.assertEqual(alice.otp_device.token_set.count(), 2)
 
     def test_spoofed_device(self):
@@ -132,10 +131,10 @@ class AuthFormTest(TestCase):
         }
         form = OTPAuthenticationForm(None, data)
 
-        self.assertTrue(not form.is_valid())
+        self.assertFalse(form.is_valid())
         alice = form.get_user()
-        self.assertTrue(alice.get_username() == 'alice')
-        self.assertTrue(alice.otp_device is None)
+        self.assertEqual(alice.get_username(), 'alice')
+        self.assertIsNone(alice.otp_device)
 
     def test_specific_device_fail(self):
         data = {
@@ -146,10 +145,10 @@ class AuthFormTest(TestCase):
         }
         form = OTPAuthenticationForm(None, data)
 
-        self.assertTrue(not form.is_valid())
+        self.assertFalse(form.is_valid())
         alice = form.get_user()
-        self.assertTrue(alice.get_username() == 'alice')
-        self.assertTrue(alice.otp_device is None)
+        self.assertEqual(alice.get_username(), 'alice')
+        self.assertIsNone(alice.otp_device)
 
     def test_specific_device(self):
         data = {
@@ -162,5 +161,5 @@ class AuthFormTest(TestCase):
 
         self.assertTrue(form.is_valid())
         alice = form.get_user()
-        self.assertTrue(alice.get_username() == 'alice')
-        self.assertTrue(alice.otp_device is not None)
+        self.assertEqual(alice.get_username(), 'alice')
+        self.assertIsNotNone(alice.otp_device)
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 5107de5..d332713 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -89,7 +89,7 @@ copyright = u'2012, Peter Sagerson'
 # The short X.Y version.
 version = '0.4'
 # The full version, including alpha/beta/rc tags.
-release = '0.4.1'
+release = '0.4.2'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff --git a/docs/source/overview.rst b/docs/source/overview.rst
index de3b028..c4c5e5d 100644
--- a/docs/source/overview.rst
+++ b/docs/source/overview.rst
@@ -401,5 +401,5 @@ Glossary
 
 .. _django-agent-trust: http://pypi.python.org/pypi/django-agent-trust
 .. _django-otp-agents: http://pypi.python.org/pypi/django-otp-agents
-.. _django-otp-yubikey: http://pypi.python.org/pypi/django-otp-yubikey
-.. _django-otp-twilio: http://pypi.python.org/pypi/django-otp-twilio
+.. _django-otp-yubikey: https://django-otp-yubikey.readthedocs.io
+.. _django-otp-twilio: https://django-otp-twilio.readthedocs.io
diff --git a/setup.py b/setup.py
index 5fccd0e..4eb36b5 100755
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ from setuptools import setup, find_packages
 
 setup(
     name='django-otp',
-    version='0.4.1.1',
+    version='0.4.2',
     description='A pluggable framework for adding two-factor authentication to Django using one-time passwords.',
     long_description=open('README.rst').read(),
     author='Peter Sagerson',

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-django-otp.git



More information about the Python-modules-commits mailing list