Skip to content

Commit

Permalink
prepare 0.11.6
Browse files Browse the repository at this point in the history
  • Loading branch information
barseghyanartur committed May 15, 2017
1 parent 0b879cf commit ae20078
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 8 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@ are used for versioning (schema follows below):
0.3.4 to 0.4).
- All backwards incompatible changes are mentioned in this document.

0.11.6
------
2017-05-15

- Minor fixes in ``drf_integration`` app, added GET/detail actions tests.

0.11.5
------
2017-05-13
2017-05-15

- Added ``date_drop_down`` to ``drf_integration`` app.
- Fixed dependencies issue.
Expand Down
1 change: 1 addition & 0 deletions requirements/django_1_10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ django-autoslug==1.9.3
django-formtools>=1.0
django-nine>=0.1.10
django-nonefield>=0.1
easy-thumbnails>=2.3
Pillow>=2.0.0
requests>=1.0.0
six>=1.9
Expand Down
5 changes: 3 additions & 2 deletions requirements/django_1_11.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
django-autoslug==1.9.3
django-formtools
django-formtools>=2.0
django-nine>=0.1.10
django-nonefield>=0.1
Pillow>=2.0.0
requests>=1.0.0
six>=1.9
Unidecode>=0.04.1
vishap>=0.1.5,<2.0
https://github.com/django/django-formtools/archive/master.tar.gz
easy-thumbnails>=2.4.1
#https://github.com/django/django-formtools/archive/master.tar.gz
1 change: 1 addition & 0 deletions requirements/django_1_5.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
django-autoslug==1.7.1
django-nine>=0.1.10
django-nonefield>=0.1
easy-thumbnails>=1.4
Pillow>=2.0.0
requests>=1.0.0
six>=1.9
Expand Down
1 change: 1 addition & 0 deletions requirements/django_1_8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ django-autoslug==1.7.1
django-formtools>=1.0
django-nine>=0.1.10
django-nonefield>=0.1
easy-thumbnails>=2.3
Pillow>=2.0.0
requests>=1.0.0
six>=1.9
Expand Down
1 change: 1 addition & 0 deletions requirements/django_1_9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ django-autoslug==1.9.3
django-formtools>=1.0
django-nine>=0.1.10
django-nonefield>=0.1
easy-thumbnails>=2.3
Pillow>=2.0.0
requests>=1.0.0
six>=1.9
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from distutils.version import LooseVersion
from setuptools import setup, find_packages

version = '0.11.5'
version = '0.11.6'

# ***************************************************************************
# ************************** Python version *********************************
Expand Down
4 changes: 2 additions & 2 deletions src/fobi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__title__ = 'django-fobi'
__version__ = '0.11.5'
__build__ = 0x000080
__version__ = '0.11.6'
__build__ = 0x000081
__author__ = 'Artur Barseghyan <[email protected]>'
__copyright__ = '2014-2017 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.1'
Expand Down
5 changes: 3 additions & 2 deletions src/fobi/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,7 @@ def _get_custom_field_instances(self,
else:
try:
custom_field_instances = self.get_custom_field_instances(
integrate_with=integrate_with,
request=request,
form_entry=form_entry,
form_element_entries=form_element_entries,
Expand Down Expand Up @@ -1837,7 +1838,7 @@ def run_integration_handler(self,
if response:
return response
else:
return (True, None)
return True, None
return (
False,
_("No integration handler for plugin {} found.").format(self.uid)
Expand Down Expand Up @@ -1868,7 +1869,7 @@ def _run_integration_handler(self,
**kwargs
)
except Exception as err:
return (False, err)
return False, err

def custom_actions(self, form_entry, request=None):
"""Custom actions.
Expand Down
32 changes: 32 additions & 0 deletions src/fobi/tests/test_drf_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,35 @@ def test_07_put_action_non_public_form_auth_user(self):
self.assertEqual(put_response.status_code, status.HTTP_200_OK)
self.assertEqual(dict(put_response.data),
dict(TEST_DYNAMIC_FORMS_PUT_DATA))

def test_08_get_action_public_form(self):
"""Test OPTIONS action call for public form."""
# Testing GET action call
get_response = self.client.get(self.url)
self.assertEqual(get_response.status_code, status.HTTP_200_OK)
self.assertIn('url', get_response.data)
self.assertIn('id', get_response.data)
self.assertIn('slug', get_response.data)
self.assertEqual(get_response.data['id'], self.form_entry.pk)
self.assertEqual(get_response.data['slug'], self.form_entry.slug)

def test_09_get_action_non_public_form_auth_user(self):
"""Test GET action call for authorised user for non-public form."""
# Testing GET action call
self.client.login(username=FOBI_TEST_USER_USERNAME,
password=FOBI_TEST_USER_PASSWORD)
get_response = self.client.get(self.non_public_url)
self.assertEqual(get_response.status_code, status.HTTP_200_OK)
self.assertIn('url', get_response.data)
self.assertIn('id', get_response.data)
self.assertIn('slug', get_response.data)
self.assertEqual(get_response.data['id'],
self.non_public_form_entry.pk)
self.assertEqual(get_response.data['slug'],
self.non_public_form_entry.slug)

def test_10_fail_get_action_non_public_form(self):
"""Test GET action call fail test for non-public form."""
# Testing GET action call
get_response = self.client.get(self.non_public_url)
self.assertEqual(get_response.status_code, status.HTTP_404_NOT_FOUND)

0 comments on commit ae20078

Please sign in to comment.