Skip to content

Commit

Permalink
Merge branch 'hotfix/v0.5.1' into development
Browse files Browse the repository at this point in the history
* hotfix/v0.5.1:
  Bump version to v0.5.1
  Update changelog
  Fix attribute error when running tests with Django 2.0 / Python 3.4
  Bump version to v0.5.0
  Update changelog
  Update changelog
  Bump version to v0.4.0
  • Loading branch information
brianschubert committed Jul 8, 2019
2 parents 0d02a31 + 47c75d1 commit 3357c09
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
24 changes: 23 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,32 @@ For complete record of changes, see the commit log of the `public git repository

.. _public git repository: https://github.com/blueschu/django-htcpcp-tea


v0.5.1
------

Released 2019-07-08

- Fix attribute error when running tests with Django 2.0 / Python 3.4

v0.5.0
------

Released 2019-07-08

- Add unit tests for the ``views`` module
- Add formal support for Python 3.7
- Expand ``utils`` unit tests
- Fix missing ``Alternates`` header due to generator exhaustion
- Fix ``Server`` header override when the WSGI implementation does not populate the ``SERVER_SOFTWARE`` variable
- Fix detection of supported teas in the request URI
- Refactor handling of ``Alternates`` header generation
- Refactor the pots data fixture to include a pot that supports a proper subset of available teas

v0.4.0
------

Released ???
Released 2019-07-05

- Add setting to override the ``Server`` header for HTCPCP responses
- Add support for user-defined forbidden combinations of additions
Expand Down
2 changes: 1 addition & 1 deletion django_htcpcp_tea/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
# MIT License was not distributed with this file, you can obtain one
# at https://opensource.org/licenses/MIT.

__version__ = '0.3.1'
__version__ = '0.5.1'

default_app_config = 'django_htcpcp_tea.apps.HTCPCPTeaConfig'
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'Brian Schubert'

# The full version, including alpha/beta/rc tags
release = '0.3.1'
release = '0.5.1'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

setup(
name='django-htcpcp-tea',
version='0.3.1',
version='0.5.1',
packages=find_packages(exclude=['tests']),
include_package_data=True,
license='MIT',
Expand Down
7 changes: 6 additions & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# MIT License was not distributed with this file, you can obtain one
# at https://opensource.org/licenses/MIT.

import django
from django.test import Client

HTCPCP_COFFEE_CONTENT = 'message/coffeepot'
Expand All @@ -27,7 +28,11 @@ def _htcpcp_post(
Mimic the functionality of Client.post, but allow for the customization
of the HTTP verb associated with a post-like request.
"""
data = self._encode_json({} if data is None else data, content_type)
if django.VERSION < (2, 1):
# self._encode_json only exists in Django>=2.1a1
data = {} if data is None else data
else:
data = self._encode_json({} if data is None else data, content_type)
post_data = self._encode_data(data, content_type)

response = self.generic(method, path, post_data, content_type, secure=secure, **extra)
Expand Down

0 comments on commit 3357c09

Please sign in to comment.