Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

creating pytest to quokkaCMS #667

Open
wants to merge 237 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 216 commits
Commits
Show all changes
237 commits
Select commit Hold shift + click to select a range
e908411
creating pytest to quokka
marcosptf Jul 5, 2018
91f9e77
add more tests-cli
marcosptf Jul 23, 2018
abebf28
add cli tests test_init();
marcosptf Jul 23, 2018
2fdf66a
add test-cli test_runserver();
marcosptf Jul 23, 2018
a19c6cd
Merge branch 'master' into feature/pytest
marcosptf Jul 24, 2018
0c3f9e9
removing tests unusual
marcosptf Jul 24, 2018
6c25410
Merge branch 'master' into feature/pytest
marcosptf Jul 24, 2018
7c7255b
removing test_basic
marcosptf Jul 31, 2018
4e6b0ac
add more tests to quokka/__init__.py
marcosptf Jul 31, 2018
dfb8e97
add more tests to quokka/__init__.py => done
marcosptf Jul 31, 2018
3329f7a
add more tests to quokka/__init__.py => dones
marcosptf Jul 31, 2018
5b44b2d
test-cli
marcosptf Jul 31, 2018
de43db8
pytest - refactory - dir
marcosptf Jul 31, 2018
6c4f3b3
pytest - refactory - dir
marcosptf Jul 31, 2018
5c72394
pytest - refactory - dir
marcosptf Jul 31, 2018
9a56d05
pytest - refactory - dir
marcosptf Jul 31, 2018
557512a
pytest - refactory - dir
marcosptf Jul 31, 2018
d5106ef
pytest - refactory - dir
marcosptf Jul 31, 2018
d4aa3e4
pytest - refactory - dir
marcosptf Jul 31, 2018
a2bfda0
pytest - refactory - dir
marcosptf Jul 31, 2018
2354b97
pytest - refactory - dir
marcosptf Jul 31, 2018
109b50d
pytest - refactory - dir
marcosptf Jul 31, 2018
fe68a93
pytest - refactory - dir
marcosptf Jul 31, 2018
836bacc
pytest - refactory - dir
marcosptf Jul 31, 2018
5d5b401
pytest - refactory - dir
marcosptf Jul 31, 2018
6ae62f5
add os.unlink to remote tmp file teardown pytest
marcosptf Jul 31, 2018
6cefd97
add new teste admin-create_admin();
marcosptf Jul 31, 2018
bd7ad2a
add more test to tests/admin/
marcosptf Aug 3, 2018
4d9ecd4
fixing or comment tests to running with make test and pep8
marcosptf Aug 8, 2018
18838f4
pytest - review defs comments
marcosptf Aug 8, 2018
8a81b78
test Quokka_configure_admin_param_admin_none
marcosptf Aug 8, 2018
9454653
test Quokka_configure_admin_param_admin_mock_QuokkaAdmin
marcosptf Aug 8, 2018
980f5e9
test create_admin && create_configure_admin();
marcosptf Aug 8, 2018
fe8e69d
def quokka.admin.configure_extra_views(app=appQk) && def quokka.admin…
marcosptf Aug 8, 2018
34af6c6
quokka/admin/__init__.py => done
marcosptf Aug 10, 2018
1870fe1
new pytest:WIP def test_PublishAction_class_def_action_toggle_publish…
marcosptf Aug 10, 2018
54146a3
pytest quokka/admin/__init__.py => done
marcosptf Aug 10, 2018
68fa985
pytest quokka/admin/test_actions.py => done
marcosptf Aug 10, 2018
5b3f5aa
pytext exception refactory test in tests/test_cli.py => done
marcosptf Aug 10, 2018
ec1fec8
add new pytests structure
marcosptf Aug 10, 2018
6320880
add new pytests structure
marcosptf Aug 10, 2018
c97dbda
add new pytests structure
marcosptf Aug 10, 2018
12efb45
add new pytests structure
marcosptf Aug 10, 2018
d772ae0
add new pytests structure
marcosptf Aug 10, 2018
ca79be7
add new pytests structure
marcosptf Aug 10, 2018
dfeb35f
add new pytests structure
marcosptf Aug 10, 2018
7d12a65
add new pytests structure
marcosptf Aug 10, 2018
496b553
add new pytests structure
marcosptf Aug 10, 2018
cb9eb13
add new pytests structure
marcosptf Aug 10, 2018
89b6d76
add new pytests structure
marcosptf Aug 10, 2018
b31ec34
add new pytests structure
marcosptf Aug 10, 2018
5cbbd98
add new pytests structure
marcosptf Aug 10, 2018
6720422
add new pytests structure
marcosptf Aug 10, 2018
f4ba596
add new pytests structure
marcosptf Aug 10, 2018
86cb11b
add new pytests structure
marcosptf Aug 10, 2018
2a52c2a
add new pytests structure
marcosptf Aug 10, 2018
4236519
add new pytests structure
marcosptf Aug 10, 2018
3133db5
add new pytests structure
marcosptf Aug 10, 2018
e1f2018
add new pytests structure
marcosptf Aug 10, 2018
befda04
add new pytests structure
marcosptf Aug 10, 2018
5c811fd
add new pytests structure
marcosptf Aug 10, 2018
64e60f4
add new pytests structure
marcosptf Aug 10, 2018
1becffe
add new pytests structure
marcosptf Aug 10, 2018
cd349d0
add new pytests structure
marcosptf Aug 10, 2018
ed19ed6
add new pytests structure
marcosptf Aug 10, 2018
c52d9c0
add new pytests structure
marcosptf Aug 10, 2018
937a13d
add new pytests structure
marcosptf Aug 10, 2018
4fba6c3
add new pytests structure
marcosptf Aug 10, 2018
fc6b5ec
add new pytests structure
marcosptf Aug 10, 2018
0089a1e
add new pytests structure
marcosptf Aug 10, 2018
e23a2da
add new pytests structure
marcosptf Aug 10, 2018
6011153
add new pytests structure
marcosptf Aug 10, 2018
0bc61f9
test_quokka_admin_ajax_unused
marcosptf Aug 10, 2018
54008b9
add codeconv and pytest-cov to quokka pytest coverage
marcosptf Aug 11, 2018
9daa352
add codeconv and pytest-cov to quokka pytest coverage - pytrohn3.6
marcosptf Aug 11, 2018
7b09ec7
add tests to quokka.admin.fields
marcosptf Aug 16, 2018
b78eba1
add tests to ContentImageField();
marcosptf Aug 16, 2018
7d14951
add pytest isinstance of to quokka/admin/__init__.py
marcosptf Aug 16, 2018
8fe95e8
add pytest isinstance of to quokka/admin/test_actions.py
marcosptf Aug 16, 2018
c6c75a1
add pytest isinstance of to quokka/admin/test_fields.py
marcosptf Aug 16, 2018
f3f1b2b
add pytest isinstance of to quokka/admin/test_views.py
marcosptf Aug 16, 2018
b99c344
add pytest fixtures setUp()
marcosptf Aug 16, 2018
49b3fc8
add quokka/admin/test_formatters.py
marcosptf Aug 18, 2018
a1e37df
add pytests to quokka/admin/test_formatters.py
marcosptf Aug 18, 2018
abc4055
fixing pytest test_SmartSelect2Field_class_assert_creation_counter_pr…
marcosptf Aug 18, 2018
971677b
fixing pytest test_ThumbField_creation_counter_property();
marcosptf Aug 18, 2018
3ce9f2e
fixing pytest test_ContentImageField_get_kwargs_property();
marcosptf Aug 18, 2018
78bed74
code refactory add pytest-fixtures to =>tests/admin/test__init__.py
marcosptf Aug 18, 2018
e9826b9
code refactory add pytest-fixtures to =>tests/admin/test_actions.py
marcosptf Aug 18, 2018
049102c
code refactory add pytest-fixtures to =>tests/admin/test_fields.py
marcosptf Aug 18, 2018
4b28d7f
code refactory add pytest-fixtures to =>tests/admin/test_formatters.py
marcosptf Aug 18, 2018
586cc67
code refactory add pytest-fixtures to =>tests/admin/test_views.py
marcosptf Aug 18, 2018
cdc2c57
code refactory add pytest-fixtures to =>tests/conftest.py
marcosptf Aug 18, 2018
784bd49
code refactory add pytest-fixtures to =>tests/test__init__.py
marcosptf Aug 18, 2018
1085fa1
code refactory add pytest-fixtures to =>tests/test_cli.py
marcosptf Aug 18, 2018
c8490bd
add tests to => quokka.admin.views.IndexView();
marcosptf Aug 18, 2018
eb1b11a
fixing pep8 identing
marcosptf Aug 18, 2018
087091e
code refactory - remove property self from functions that is not clas…
marcosptf Aug 18, 2018
90d6d44
fixing import errors
marcosptf Aug 18, 2018
624de39
pytest test_forms.py
marcosptf Aug 30, 2018
301da1b
add pytest quokka.admin.fields.CallableValidator();
marcosptf Sep 4, 2018
68bec1a
test_views.py WIP:
marcosptf Sep 6, 2018
c64dfb0
remove debugger code WIP from test_forms.py
marcosptf Sep 15, 2018
1a7e787
remove debugger code WIP from test_views.py
marcosptf Sep 15, 2018
226eb50
writing pytest to b/tests/admin/test_formatters.py def test_format_da…
marcosptf Sep 16, 2018
2ac1d3a
fixing git merge conflicts
marcosptf Sep 16, 2018
9585a6b
add pytest to quokka.admin.formatters.py
marcosptf Sep 17, 2018
88b22c1
fixing import
marcosptf Sep 17, 2018
c689b29
add test to quokka.admin.widgets
marcosptf Sep 17, 2018
35a2ebe
add pytest to quokka.admin.wtforms_html5
marcosptf Sep 17, 2018
dc8ad7a
fixing comment to wrong import
marcosptf Sep 17, 2018
de97828
pytest tests/core/content/tests*.py refactory
marcosptf Sep 17, 2018
fd2fe53
pytest tests/core/content/tests*.py refactory - add pytest files
marcosptf Sep 17, 2018
b96bdc6
pytest add test.quokka.core.content.test_admin.py
marcosptf Sep 18, 2018
31c72bc
pytest:tests/core/__init__.py
marcosptf Sep 20, 2018
da0ff32
pytest:tests/core/content/test_admin.py
marcosptf Sep 20, 2018
4e3e44e
WIP: tests/core/content/test_admin.py:test_AdminContentView
marcosptf Sep 24, 2018
6f4a89b
WIP: tests/core/content/test_admin.py
marcosptf Sep 29, 2018
8f84540
pytest tests/core/content/test_formats.py
marcosptf Sep 29, 2018
4007f81
pytest tests/core/content/test_models.py
marcosptf Sep 29, 2018
b07f2e7
pytest tests/core/views/test_sitemap.py
marcosptf Sep 29, 2018
d87470d
pytest tests/module_template/quokka_module_template/
marcosptf Sep 29, 2018
db6cbfb
pytest tests/core/content/test_paginator.py
marcosptf Sep 29, 2018
ea9c01d
pytest tests/core/content/test_parsers.py
marcosptf Sep 29, 2018
8b78ec9
pytest tests/core/content/test_utils.py
marcosptf Sep 29, 2018
cc00bfe
pytest tests/core/content/test_views.py
marcosptf Sep 29, 2018
02fdd91
pytest tests/core/test_app.py
marcosptf Sep 29, 2018
c2d3253
pytest tests/core/test_auth.py
marcosptf Sep 29, 2018
282a43d
pytest tests/core/test_blueprints.py
marcosptf Sep 29, 2018
657fc0c
pytest tests/core/test_commands_collector.py
marcosptf Sep 29, 2018
f303469
pytest tests/core/test_context_processors.py
marcosptf Sep 29, 2018
6816374
pytest tests/core/test_db.py
marcosptf Sep 29, 2018
aa4b459
pytest tests/core/test_error_handlers.py
marcosptf Sep 29, 2018
681b8fe
pytest tests/core/test_flask_dynaconf.py
marcosptf Sep 29, 2018
4250c0c
pytest tests/core/test_flask_dynaconf.py
marcosptf Sep 29, 2018
0a23a58
pytest tests/core/test_logger.py
marcosptf Sep 29, 2018
eaa547a
tests/core/test_monitoring.py
marcosptf Sep 29, 2018
54dd97c
pytest tests/core/test_regex_url_support.py
marcosptf Sep 29, 2018
77326bb
pytest tests/core/test_template_filters.py
marcosptf Sep 29, 2018
66f4d07
pytest tests/core/test_themes.py
marcosptf Sep 29, 2018
39f260a
pytest remove wrong file tests/core/test_themes.py
marcosptf Sep 29, 2018
8854c54
pytest remove wrong file tests/core/views/sitemap.py
marcosptf Sep 29, 2018
c0cd8fa
pytest tests/module_template/test_setup.py
marcosptf Sep 29, 2018
ccc3959
pytest tests/test_cli.py
marcosptf Sep 29, 2018
8301cb6
pytest tests/utils/test_atom.py
marcosptf Sep 29, 2018
0e33041
pytest tests/utils/test_blocks.py
marcosptf Sep 29, 2018
e34f673
pytest removing wrong file tests/utils/test_custom_dateformat.py
marcosptf Sep 29, 2018
45d369a
pytest tests/utils/test_custom_vars.py
marcosptf Sep 29, 2018
e8c60eb
pytest tests/utils/test_dateformat.py
marcosptf Sep 29, 2018
034b436
pytest tests/utils/test_echo.py
marcosptf Sep 29, 2018
876015f
tests/utils/test_project.py
marcosptf Sep 29, 2018
4847cd4
pytest tests/utils/test_routing.py
marcosptf Sep 29, 2018
d558239
pytest tests/utils/test_text.py
marcosptf Sep 29, 2018
2d0c392
pytest tests/utils/test_upload.py
marcosptf Sep 29, 2018
7745717
fixing imports tests/core/test_context_processors.py
marcosptf Sep 29, 2018
1e3600f
fixing imports tests/core/content/test_views.py
marcosptf Sep 29, 2018
a2f01b5
fixing imports tests/utils/test_project.py
marcosptf Sep 29, 2018
a636bd5
remove import unused
marcosptf Oct 18, 2018
2da9743
remove unused lines
marcosptf Oct 18, 2018
c76da13
code refactory and add more tests to tests/core/__init__.py
marcosptf Oct 18, 2018
2931631
add more tests to tests/core/test__init__.py
marcosptf Oct 19, 2018
ea053a5
add pytest to tests/core/__init__.py
marcosptf Oct 21, 2018
4e2e694
add pytest to tests/core/__init__.py fixing imports spaces removing tabs
marcosptf Oct 21, 2018
f0e6e80
add pytest tests/core/test_app.py
marcosptf Oct 21, 2018
48deb54
add pytest to tests/core/test_app.py
marcosptf Oct 22, 2018
f9c99c6
add pytest tests/core/content/test_admin.py::test_AdminContentView
marcosptf Oct 22, 2018
4c58c23
add tests/core/content/test_admin.py more pytests which real mocks c…
marcosptf Nov 1, 2018
9f6f8f4
add more verbosity to pytest
marcosptf Nov 3, 2018
5fc9d5d
remove comments unused
marcosptf Nov 3, 2018
68ee2f1
add pytest headers to tests/core/content/test_formats_.py and remove …
marcosptf Nov 3, 2018
3c2e0a1
pytest - tests/core/content/test_formats.py
marcosptf Nov 3, 2018
82ffa06
pytest - tests/core/content/test_formats.py
marcosptf Nov 3, 2018
1755c2a
pytest - tests/core/content/test_formats.py - test_validate_category_…
marcosptf Nov 3, 2018
d13c501
pytest - tests/core/content/test_formats.py - done
marcosptf Nov 3, 2018
7574fba
code refactor from TestClassPytestExtendsAdminContentView to MockTest…
marcosptf Nov 3, 2018
33ee5d4
code refactory remove pytest warnings MockTestAdminArticlesView
marcosptf Nov 3, 2018
5145c8a
fixing warning pytest MockTestAdminPagesView
marcosptf Nov 3, 2018
316a239
code refactory fixing warnings in pytest code TestAdminBlocksView
marcosptf Nov 3, 2018
2e980fc
remove validation pep8 from make test temporary
marcosptf Nov 4, 2018
68eb47c
pytest tests/core/content/test_models.py::Orderable();
marcosptf Nov 8, 2018
f13f801
pytest tests/core/content/test_models.py::Category();
marcosptf Nov 8, 2018
e5f5833
pytest tests/core/content/test_models.py::Url();
marcosptf Nov 8, 2018
1a29a56
pytest tests/core/content/test_models.py::Authors();
marcosptf Nov 8, 2018
5d966ab
pytest tests/core/content/test_models.py::Tag();
marcosptf Nov 8, 2018
52aab92
pytest tests/core/content/test_models.py::Article();
marcosptf Nov 8, 2018
ee1bbc5
pytest tests/core/content/test_models.py::Page();
marcosptf Nov 8, 2018
a35471d
pytest tests/core/content/test_models.py::Block();
marcosptf Nov 8, 2018
748c75d
pytest tests/core/content/test_models.py::BlockItem();
marcosptf Nov 8, 2018
018ac73
pytest tests/core/content/test_models.py - code refactory;
marcosptf Nov 8, 2018
710c0fa
pytest tests/core/content/test_models.py - code refactory2;
marcosptf Nov 8, 2018
bda0317
pytest tests/core/test_app.py - code refactory;
marcosptf Nov 8, 2018
20c8b15
pytest tests/core/views/test_sitemap.py
marcosptf Nov 9, 2018
2a74bc5
tests/core/content/test_views.py - code refactory imports
marcosptf Nov 10, 2018
e2008f0
pytest tests/core/content/test_views.py - BaseView();
marcosptf Nov 10, 2018
82f6ef9
pytest tests/core/content/test_views.py - done
marcosptf Nov 10, 2018
ca58975
pytest - tests/core/content/test_utils.py
marcosptf Nov 10, 2018
5d201a7
pytest - tests/core/content/test_parsers.py
marcosptf Nov 10, 2018
a2288b4
pytest - tests/core/content/test_paginator.py
marcosptf Nov 10, 2018
40edb96
pytest - tests/core/test_auth.py
marcosptf Nov 10, 2018
5f362ae
pytest - tests/core/test_commands_collector.py
marcosptf Nov 10, 2018
0151817
tests/core/test_error_handlers.py
marcosptf Nov 10, 2018
bea9523
pytest - tests/core/test_monitoring.py
marcosptf Nov 10, 2018
7217853
pytest - tests/core/test_template_filters.py
marcosptf Nov 11, 2018
caafca6
pytest - tests/module_template/quokka_module_template/test_admin.py
marcosptf Nov 11, 2018
9c89088
pytest - tests/module_template/quokka_module_template/test_admin.py -
marcosptf Nov 11, 2018
9be4452
pytest - tests/utils/test_atom.py
marcosptf Nov 11, 2018
b4a6632
pytest - tests/utils/test_atom.py
marcosptf Nov 11, 2018
8d257ce
pytest - tests/utils/test_custom_vars.py
marcosptf Nov 11, 2018
60f361f
pytest - tests/utils/test_custom_vars.py - split-category
marcosptf Nov 11, 2018
3bfa29c
finish pytest to quokka
marcosptf Nov 11, 2018
cbd3214
pytest - code refacory
marcosptf Nov 11, 2018
e813fe3
Delete tqdm.1
marcosptf Nov 11, 2018
3ee8314
Delete pip-selfcheck.json
marcosptf Nov 11, 2018
10045ac
finish code refactory feature/pytest
marcosptf Nov 11, 2018
2ea8aef
Merge branch 'feature/pytest' of https://github.com/marcosptf/quokka …
marcosptf Nov 11, 2018
b1f221e
Merge branch 'master' of https://github.com/rochacbruno/quokka into f…
marcosptf Nov 11, 2018
345eed9
rollback quokka/admin/formatters.py to original from master branch
marcosptf Nov 22, 2018
a196262
rollback quokka/admin/widgets.py to original from master branch
marcosptf Nov 22, 2018
def4765
fixing quokka/admin/widgets.py that had a wrong import => from quokka…
marcosptf Nov 22, 2018
323e196
fixing pep8
marcosptf Nov 30, 2018
db56808
fixing pep8 - makefile
marcosptf Nov 30, 2018
1a1c4f5
@laerteallan pep8 + code refactory done
marcosptf Nov 30, 2018
0fa91fc
@laerteallan pep8 + code refactory done2
marcosptf Nov 30, 2018
568d9ac
@laerteallan pep8 + code refactory done3
marcosptf Nov 30, 2018
cfb65c5
Merge branch 'master' into feature/pytest
marcosptf May 19, 2019
4fa0c64
fixing test to be more resilent!
May 20, 2019
76b18fb
Delete pyvenv.cfg
marcosptf May 20, 2019
35728dd
Delete ipython.1.gz
marcosptf May 20, 2019
211d5c8
fixing pep8 => tests/admin/test__init__.py
marcosptf Jun 2, 2019
574b439
fixing pep8 - quokka/core/content/models.py - quokka/core/db.py
marcosptf Jun 2, 2019
92552c6
ficing pep8 => quokka/core/db.py
marcosptf Jun 2, 2019
cf97137
fixing pep8 => quokka/core/db.py - 2
marcosptf Jun 2, 2019
09cd5e8
fixing pep8 => quokka/core/db.py - 3
marcosptf Jun 2, 2019
b548335
fixing pep8 => quokka/core/db.py - 3
marcosptf Jun 2, 2019
34dbd83
fixing pep8 => quokka/core/db.py - 5
marcosptf Jun 2, 2019
3a2896b
fixing pep8 => quokka/core/db.py - 6
marcosptf Jun 2, 2019
7f02761
fixing pep8 => quokka/admin/wtforms_html5.py - quokka/utils/upload.py
marcosptf Jun 2, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,4 @@ docs/book
.eggs

README.rst
/nbproject/private/
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ install:
- make install
script: make test
after_success:
- codecov
- coveralls
notifications:
slack: quokkaproject:pjF8y81mqwXxQRtf5sGz5zqr
3 changes: 3 additions & 0 deletions .venv/pyvenv.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
home = /usr/bin
include-system-site-packages = false
version = 3.6.1
Binary file added .venv/share/man/man1/ipython.1.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: docs test pep8 clean install build publish tree create_env devserver pandoc adduser

test: pep8
QUOKKA_MODE=test py.test --cov=quokka -l --tb=short --maxfail=1 tests/
test:
QUOKKA_MODE=test pytest -vvv --cov=quokka -l --tb=short --maxfail=1 tests/

pep8:
@flake8 quokka --ignore=F403 --exclude=migrations
Expand Down
20 changes: 10 additions & 10 deletions quokka/admin/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from quokka.core.content.models import make_model


def format_datetime(self, request, obj, fieldname, *args, **kwargs):
def format_datetime(request, obj, fieldname, *args, **kwargs):
"""Returns the formated datetime in string from object"""
model = make_model(obj)
return html.div(style='min-width:130px;')(
Expand All @@ -13,7 +13,7 @@ def format_datetime(self, request, obj, fieldname, *args, **kwargs):
)


def format_view_on_site(self, request, obj, fieldname, *args, **kwargs):
def format_view_on_site(request, obj, fieldname, *args, **kwargs):
"""Returns button to view or preview depending on content status"""
model = make_model(obj)
return html.a(
Expand All @@ -24,19 +24,19 @@ def format_view_on_site(self, request, obj, fieldname, *args, **kwargs):
'View' if model.published else 'Preview')


def format_ul(self, request, obj, fieldname, *args, **kwars):
def format_ul(request, obj, fieldname, *args, **kwars):
"""Given a list of data format it is ul/li"""
model = make_model(obj)
field = getattr(model, fieldname)
column_formatters_args = getattr(self, 'column_formatters_args', {})
column_formatters_args = getattr('column_formatters_args', {})
_args = column_formatters_args.get('ul', {}).get(fieldname, {})
ul = html.ul(style=_args.get('style', "min-width:200px;max-width:300px;"))
placeholder = _args.get('placeholder', u"{i}")
lis = [html.li(placeholder.format(item=item)) for item in field]
return ul(*lis)


def format_link(self, request, obj, fieldname, *args, **kwars):
def format_link(request, obj, fieldname, *args, **kwars):
"""Format a link from the model"""
model = make_model(obj)
value = getattr(model, fieldname)
Expand All @@ -46,11 +46,11 @@ def format_link(self, request, obj, fieldname, *args, **kwars):
)


def format_status(self, request, obj, fieldname, *args, **kwargs):
def format_status(request, obj, fieldname, *args, **kwargs):
"""Format the status published or not published and other booleans"""
model = make_model(obj)
status = getattr(model, fieldname)
column_formatters_args = getattr(self, 'column_formatters_args', {})
column_formatters_args = getattr('column_formatters_args', {})
_args = column_formatters_args.get('status', {}).get(fieldname, {})
labels = _args.get('labels', {})
return html.span(
Expand All @@ -59,9 +59,9 @@ def format_status(self, request, obj, fieldname, *args, **kwargs):
)(status)


def format_url(self, request, obj, fieldname, *args, **kwargs):
def format_url(request, obj, fieldname, *args, **kwargs):
"""Get the url of a content object"""
column_formatters_args = getattr(self, 'column_formatters_args', {})
column_formatters_args = getattr('column_formatters_args', {})
_args = column_formatters_args.get('get_url', {}).get(fieldname, {})
attribute = _args.get('attribute', 'url')
method = _args.get('method', 'url')
Expand All @@ -77,7 +77,7 @@ def format_url(self, request, obj, fieldname, *args, **kwargs):
return html.a(href=url)(text if text not in [None, 'None'] else '')


def format_custom_vars(self, request, obj, fieldname, *args, **kwargs):
def format_custom_vars(request, obj, fieldname, *args, **kwargs):
ul = html.ul(style="min-width:200px;max-width:300px;")
lis = [
html.li(
Expand Down
3 changes: 2 additions & 1 deletion quokka/admin/widgets.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

from flask import current_app
from quokka.core.template import render_template
# from quokka.core.template import render_template => wrong import
from quokka.core.content.views import render_template
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixing pep8 import

from wtforms.widgets import TextArea, TextInput


Expand Down
4 changes: 4 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ twine>=1.9.1
wheel>=0.30.0
flask>=1.0
logzero
pytest_mock
mock
pytest_django
pyyaml
Empty file added tests/__init__.py
Empty file.
Empty file added tests/admin/__init__.py
Empty file.
Loading