http://hg.code.sf.net:8000/p/roundup/code/atom-log/tip/test/test_templating.py Mercurial Repository: p/roundup/code: test/test_templating.py history 2026-04-08T21:39:40-04:00 chore: remove __future print_funcion from code. http://hg.code.sf.net:8000/p/roundup/code/#changeset-9c3ec0a5c7fc88acb8a65632ecc13b2d52380314 John Rouillard rouilj@ieee.org 2026-04-08T21:39:40-04:00 2026-04-08T21:39:40-04:00
changeset 9c3ec0a5c7fc
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description chore: remove __future print_funcion from code.

Not needed as of Python 3.
files
issue2551323: Remove XHTML support http://hg.code.sf.net:8000/p/roundup/code/#changeset-9369e0958312b73c08c7d2eeb3d132ac0af56b48 John Rouillard rouilj@ieee.org 2025-05-11T20:26:42-04:00 2025-05-11T20:26:42-04:00
changeset 9369e0958312
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551323: Remove XHTML support

Deprecated in Roundup 2.3.0, invalid in 2.4.0, and removing supporting
code in 2.5.0.
files
fix: tests for changeset: 8314:7ff47307b4b1 use text for number input http://hg.code.sf.net:8000/p/roundup/code/#changeset-4455cd036c2563d0f26f8f0d2871346b2e931144 John Rouillard rouilj@ieee.org 2025-05-11T20:22:45-04:00 2025-05-11T20:22:45-04:00
changeset 4455cd036c25
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix: tests for changeset: 8314:7ff47307b4b1 use text for number input
files
Generate savepoint only if necessary http://hg.code.sf.net:8000/p/roundup/code/#changeset-a81a3cd067fa00f483078fcabbba56d1ac7eee6b Ralf Schlatterbeck rsc@runtux.com 2025-03-01T18:55:54+01:00 2025-03-01T18:55:54+01:00
changeset a81a3cd067fa
branch
bookmark
tag
user Ralf Schlatterbeck <rsc@runtux.com>
description Generate savepoint only if necessary

Now some methods got an additional 'allow_abort' parameter. By default
this is True. When False the postgres backend generates a savepoint.
The methods are called with allow_abort=False from some of the cgi
methods which can produce a traceback when called with data from the
web-interface.
files
Make native date and number elements configurable http://hg.code.sf.net:8000/p/roundup/code/#changeset-b99e76e764967599da7978a4d57365a155f8827e Ralf Schlatterbeck rsc@runtux.com 2025-02-19T12:38:06+01:00 2025-02-19T12:38:06+01:00
changeset b99e76e76496
branch
bookmark
tag
user Ralf Schlatterbeck <rsc@runtux.com>
description Make native date and number elements configurable

Now for Number() and Integer() properties the browser-native number
format can be configured with the use_browser_number_input config item
in seciont [web]. The default is 'yes'. For Date() properties the config
item is use_browser_date_input (also in section [web]) but the default
is 'no'.

In addition when defining Date() properties, these now have a parameter
'display_time' which defaults to 'yes' and a 'format' parameter which
defaults to None. These set defaults for the field() method of the
DateHTMLProperty which have the same parameters (but the display_time
parameter of field() takes a boolean, not 'yes'/'no').
files
refactor: change method used to assign radiobuttons for boolean http://hg.code.sf.net:8000/p/roundup/code/#changeset-46886073c6650897a539d6ceb816aa0eafc11b61 John Rouillard rouilj@ieee.org 2025-01-18T17:43:08-05:00 2025-01-18T17:43:08-05:00
changeset 46886073c665
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description refactor: change method used to assign radiobuttons for boolean

use setdefault('type', 'radiobutton') rather than hardcoding the value
into the underlying self.input (input_html4) call.

Also add test for undefined radiobutton.
files
test: basic testing for BooleanHTMLProperty http://hg.code.sf.net:8000/p/roundup/code/#changeset-e70dc7c43c9cd16c5830fd78d15c5a92ab341902 John Rouillard rouilj@ieee.org 2025-01-18T16:54:35-05:00 2025-01-18T16:54:35-05:00
changeset e70dc7c43c9c
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description test: basic testing for BooleanHTMLProperty

plain and field.
files
test - fix broken test http://hg.code.sf.net:8000/p/roundup/code/#changeset-60e682add9ea607cce0809f318ae62a166c4ad20 John Rouillard rouilj@ieee.org 2025-01-18T15:15:42-05:00 2025-01-18T15:15:42-05:00
changeset 60e682add9ea
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description test - fix broken test

Had a test case for number inputs that I didn't know about.
testmon didn't detect it had to be run.
files
feat(web) - Use native number type input for Number() and Integer(). http://hg.code.sf.net:8000/p/roundup/code/#changeset-6445e63bb423fe66f50ac30b2407d10eb2956eac John Rouillard rouilj@ieee.org 2025-01-18T14:54:31-05:00 2025-01-18T14:54:31-05:00
changeset 6445e63bb423
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description feat(web) - Use native number type input for Number() and Integer().

When editing hyperdb.Number() or hyperdb.Integer() properties, use a
native number input.

For Number you can enter digits, +/-, . and e/E for exponent (1E2 =
100).

For integer we have the same keys as number, but also add step=1 to
the input. This stops submitting 23.5 suggesting 23 or 24. It does
allow 2E4 to be submitted that is rejected with an error from the
backend. However if the spinner is used with 2E4 it is turned into
20000, a pure integer and incremented/decremented by the spinner.

The upgrade happens automatically. Directions on going back to text
input provided. User guide updated to describe addition of spinner.

Tests added.
files
fix: issue2551390 - Replace text input/calendar popup with native date input http://hg.code.sf.net:8000/p/roundup/code/#changeset-2bf0c4e7795e383a6722e70d071361bb3db45b2c John Rouillard rouilj@ieee.org 2025-01-18T12:23:23-05:00 2025-01-18T12:23:23-05:00
changeset 2bf0c4e7795e
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix: issue2551390 - Replace text input/calendar popup with native date input

Docs, code and test changes for the changeover to a native date
element.

See issue for details.
files
issue2551391 - checkboxes and radiobutton inputs get wrong id's. http://hg.code.sf.net:8000/p/roundup/code/#changeset-669dfccca89860ec425a3ece589811ef15696df8 John Rouillard rouilj@ieee.org 2025-01-16T02:32:58-05:00 2025-01-16T02:32:58-05:00
changeset 669dfccca898
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551391 - checkboxes and radiobutton inputs get wrong id's.

Actually it breaks automatic id assignment for all inputs.

Inputs now get an automatic id assignment that matches the name.
It can be overridden by supplting an id parameter in the call to
the field() method.

This is also a partial fix for issue1513369. I think it obsoletes the
changes to templating.py.
files
feat: issue1525113 - notation to filter by logged-in user http://hg.code.sf.net:8000/p/roundup/code/#changeset-a9b1365658388afef20fbfdb6d1dd8cd59e7b424 John Rouillard rouilj@ieee.org 2024-05-06T00:49:43-04:00 2024-05-06T00:49:43-04:00
changeset a9b136565838
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description feat: issue1525113 - notation to filter by logged-in user

At long last (almost 18 years) this patch lands. It allows sharing of
queries that want to use the currently logged in user (i.e. I or me).
By replacing an id number for the user by '@current_user' in the query
you can share the query for "my issues" where 'my' is the logged in
user not the person who created the query.

Updated the templates to use this.
Updated upgrading.py for directions on using it.
RDBMS and anydbm both work. Also expressions using it (e.g. not
@current_user) work and are tested.
Test code done.


I am not sure what the change to templating.py does. I am following
the original patch and have built a test case to hit the if
clause. But the rest of the test doesn't actualy provide the props I
need. If I knew what that code was supposed to do there I would create
a real test.
files
issue2551285 - Remove StructuredText support http://hg.code.sf.net:8000/p/roundup/code/#changeset-29a666d8a70d065186db60f9dff44ead46b299a6 John Rouillard rouilj@ieee.org 2024-04-30T22:27:57-04:00 2024-04-30T22:27:57-04:00
changeset 29a666d8a70d
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551285 - Remove StructuredText support

Asked on the users mailing list if anybody was using it. Got no responses.
I have never seen CI installing structuredtext packages so it's
untested as well.
files
issue2551331 - Fix repeat first/last methods. http://hg.code.sf.net:8000/p/roundup/code/#changeset-9bbc1d951677d29244bd0936142854a34cc93f4c John Rouillard rouilj@ieee.org 2024-04-07T20:52:17-04:00 2024-04-07T20:52:17-04:00
changeset 9bbc1d951677
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551331 - Fix repeat first/last methods.

The first() and last() methods for a variable defined by tal:repeat
now work as documented.

There is an undocumented same_part() method for repeat. It is called
by first/last and can cause them to return true when not at an end of
the Iterator sequence. I wrote a treatise on that function and what it
does. I have no idea why it does what it does.

Added tests for roundup/cgi/ZTUtils/Iterator.py

Also fixes issue with roman() found while writing tests. lower wasn't
being called and it was printing the lower() method signature.

Doc updates in references.txt to come in a future checkin. Clarifying
the repeat methods led to finding/fixing this.
files
fix: document/fix wrapped HtmlProperty method. http://hg.code.sf.net:8000/p/roundup/code/#changeset-b080cdb8b19909930f738068151224d8f93bf787 John Rouillard rouilj@ieee.org 2024-04-07T15:27:18-04:00 2024-04-07T15:27:18-04:00
changeset b080cdb8b199
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix: document/fix wrapped HtmlProperty method.

The wrapped method was not documented in reference.txt.

It is now documented in reference.txt. The docstring documented that
it would not break up long words. Fixed by adding
break_long_words=False to prevent breaking string longer than the wrap
length. Wrapping was breaking the hyperlinking of long urls.

Added columns argument to set the wrap length (default 80 columns).
files
fix: issue2551193 - Fix roundup for removal of cgi and cgitb ... http://hg.code.sf.net:8000/p/roundup/code/#changeset-978285986b2c9d73f4a39d745ab6a3bbab58af3d John Rouillard rouilj@ieee.org 2023-07-24T17:49:58-04:00 2023-07-24T17:49:58-04:00
changeset 978285986b2c
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix: issue2551193 - Fix roundup for removal of cgi and cgitb ...

standard python modules (and FieldStorage/MiniFieldStorage).

Vendor cgi.py and modify imports.

Details:

roundup/anypy/cgi_.py
import that accesses a working cgi.py. All imports dealing with cgi
now use cgi_.

roundup/anypy/vendored/cgi.py
vendored version 2.6 of cgi.py from:
https://pypi.org/project/legacy-cgi/

CHANGES.txt
change note added

COPYING.txt
added license for cgi.py

doc/rest.txt
change example to use cgi_

doc/upgrading.txt
doc removal and how to rework local code using cgi.py.

frontends/roundup.cgi
remove unneeded cgi import

roundup/cgi/actions.py
roundup/cgi/apache.py
roundup/cgi/client.py
roundup/cgi/templating.py
roundup/cgi/TAL/TALGenerator.py
test/db_test_base.py
test/rest_common.py
test/test_cgi.py
remove import cgi and replace with from roundup.anypy.cgi_ import
cgi

test/test_actions.py
test/test_templating.py
modify import to get *FieldStorage

test/test_admin.py
test/test_hyperdbvals.py
test/test_xmlrpc.py
remove unneeded cgi import
files
Handle error id markdown2 not defined. http://hg.code.sf.net:8000/p/roundup/code/#changeset-7bdf9c0f74b913b72a1c23be8c5573a67b262714 John Rouillard rouilj@ieee.org 2023-07-24T00:13:31-04:00 2023-07-24T00:13:31-04:00
changeset 7bdf9c0f74b9
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Handle error id markdown2 not defined.
files
Support markdown2 2.4.10, 2.4.8- and exclude 2.4.9 http://hg.code.sf.net:8000/p/roundup/code/#changeset-91725f12b239eecd32b6ee4e0a2e880774c1768f John Rouillard rouilj@ieee.org 2023-07-23T16:50:35-04:00 2023-07-23T16:50:35-04:00
changeset 91725f12b239
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Support markdown2 2.4.10, 2.4.8- and exclude 2.4.9

Handle these changes to markdown2

version 2.4.9 broke links like (issue1)[issue1]: raise error if used

Version 2.4.10 changed how filtering of schemes is done: adapt to new
method


Mail url's in markdown are formatted
[label](mailto:user@something.com). The markdown format wrapper uses
the plain text formatter to turn issue1 and user@something.com into
markdown formatted strings to be htmlized by the markdown formatters.

However when the plain text formatter saw (mailto:user@something.com)
it made it (mailto:<user@something.com>). This is broken as the enamil
address shouldn't have the angle brackets. By modifying the email
pattern to include an optional mailto:, all three markdown formatters
do the right thing and I don't end up with href="<user@something.com>"
in the link.
files
flake8: fix imports, http://hg.code.sf.net:8000/p/roundup/code/#changeset-f529cca242dcf8eff44f95dcec7cc5c3c0e53484 John Rouillard rouilj@ieee.org 2022-10-09T18:40:46-04:00 2022-10-09T18:40:46-04:00
changeset f529cca242dc
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description flake8: fix imports,

flake8 reported the following:

templating.py:25:1: F401 'base64' imported but unused
templating.py:25:1: F401 'mimetypes' imported but unused
templating.py:25:1: F401 'string' imported but unused
templating.py:28:1: F401 'time' imported but unused
templating.py:28:1: F401 'hashlib' imported but unused
templating.py:34:1: F401 'roundup.i18n' imported but unused
templating.py:35:1: F401 'roundup.i18n._' imported but unused
templating.py:36:1: F401 'roundup.anypy.strings.b2s' imported but unused
templating.py:36:1: F401 'roundup.anypy.strings.s2b' imported but unused
templating.py:43:1: F401 'roundup.anypy.random_' imported but unused
templating.py:47:5: F401 'pickle' imported but unused

Turns out time import was used by test_templating via

from roundup.cgi.templating import *

so added import time to test_templating

Also split out multiple imports on one line into sepearate lines.
Changed
todo =

to
__todo__

to make flake8 shut up about module level imports not at top of
file. Moved definiton of _disable_url_schemes for same reason.
files
change test to use html normalizer when comparing html output. http://hg.code.sf.net:8000/p/roundup/code/#changeset-dc83ebff4c90d1183b219c997bdb4be3144dec02 John Rouillard rouilj@ieee.org 2022-10-02T23:18:43-04:00 2022-10-02T23:18:43-04:00
changeset dc83ebff4c90
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description change test to use html normalizer when comparing html output.

Update to Markdown2 parser changed text output keeping same html
semantics. Broke test_string_markdown_code_block_attribute test. I
hand patched it to get tests working but it needed a better solution.

Write a simple html normalizer using HTMLParser so I don't need third
party (lxml, beautifulsoup) library to clean up the test.

Use the normalizer to parser the expected result and the result
returned by the various markdown libraries. Hopefully this will make
the test less fragile.

This can have multiple uses in template testing where html is
compared. I expect to have to change html_norm.py to make test
writing easier in the future.
files
New markdown2 release changed output with code highlighting (take 2) http://hg.code.sf.net:8000/p/roundup/code/#changeset-a5f30372ef7f598b45cf87b43797c101c9bf10ae John Rouillard rouilj@ieee.org 2022-10-01T22:10:48-04:00 2022-10-01T22:10:48-04:00
changeset a5f30372ef7f
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description New markdown2 release changed output with code highlighting (take 2)

code highight div generated/used by pygments is on a separate line in
2.4.4 release of markdown2.

python 2.7 still needs expected form without additonal newlines as
2.4.4 is python3 only.
files
New markdown2 release changed output with code highlighting http://hg.code.sf.net:8000/p/roundup/code/#changeset-3085aac22f3a5acab83f5a68aae0cf0c2eb04e1b John Rouillard rouilj@ieee.org 2022-10-01T21:31:27-04:00 2022-10-01T21:31:27-04:00
changeset 3085aac22f3a
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description New markdown2 release changed output with code highlighting

code highight div generated/used by pygments is on a separate line in
2.4.4 release of markdown2.
files
issue2550559 - Pretty printing / formatting for Number types. http://hg.code.sf.net:8000/p/roundup/code/#changeset-234fefd7568a30e90bd54a033422ab9ad98dd8d8 John Rouillard rouilj@ieee.org 2022-08-16T22:39:04-04:00 2022-08-16T22:39:04-04:00
changeset 234fefd7568a
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2550559 - Pretty printing / formatting for Number types.

add pretty(format='%0.3f') method to NumberHTMLProperty.
files
Fix anti_csrf_nonce test http://hg.code.sf.net:8000/p/roundup/code/#changeset-28b906a237d8b9de23968be8477e14e5525f80de John Rouillard rouilj@ieee.org 2022-08-07T04:18:20-04:00 2022-08-07T04:18:20-04:00
changeset 28b906a237d8
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Fix anti_csrf_nonce test

Make the MockDatabase inherit from roundup.backends.sessions_common
SessionCommon. This provides the getUniqueKey method.

Also the encoding as base64 changed the length, so had to adjust the
assert.
files
fix mock datbase http://hg.code.sf.net:8000/p/roundup/code/#changeset-38b73f7495f8c1ff1ec435949d4a7ed9c3fdfaac John Rouillard rouilj@ieee.org 2022-08-04T16:11:59-04:00 2022-08-04T16:11:59-04:00
changeset 38b73f7495f8
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix mock datbase

add lifetime() method. caused tests to break. Use time.mie() - week +
lifetime.

set() method sets __timestamp if not set.

add getall useful for debugging.
files
Fix traceback if an order attribute is None http://hg.code.sf.net:8000/p/roundup/code/#changeset-994893cf3e1aa8a4e26a3bf037cd2afd4509da29 Ralf Schlatterbeck rsc@runtux.com 2022-05-30T18:03:39+02:00 2022-05-30T18:03:39+02:00
changeset 994893cf3e1a
branch
bookmark
tag
user Ralf Schlatterbeck <rsc@runtux.com>
description Fix traceback if an order attribute is None

Fixes issue2551207.
files
remove error introduced to test the test. http://hg.code.sf.net:8000/p/roundup/code/#changeset-b598b46eb427fc255df33c2c2203716f02fa9eb1 John Rouillard rouilj@ieee.org 2022-04-28T16:08:57-04:00 2022-04-28T16:08:57-04:00
changeset b598b46eb427
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description remove error introduced to test the test.
files
remove printing to stderr. http://hg.code.sf.net:8000/p/roundup/code/#changeset-81d16e9f0f5400507b20571a404f6ea436748760 John Rouillard rouilj@ieee.org 2022-04-28T14:48:23-04:00 2022-04-28T14:48:23-04:00
changeset 81d16e9f0f54
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description remove printing to stderr.

That was an attempt to get the full stdout/stderr output to be produced
by pytest for a test marked xfail.
files
try to get more info on failing test http://hg.code.sf.net:8000/p/roundup/code/#changeset-5b71a50e833b7e16c2b2da91899e960e32e9a2d6 John Rouillard rouilj@ieee.org 2022-04-28T00:19:52-04:00 2022-04-28T00:19:52-04:00
changeset 5b71a50e833b
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description try to get more info on failing test

looks like m is not being formatted for markdown2 test case. No idea
why. Trying to make output more verbose to figure out what's happening.

pip in ci reports version 2.4.2 of markdown2 according to:

https://app.travis-ci.com/github/roundup-tracker/roundup/jobs/568309619

same version I run locally with python 3.6.9. Fails in CI on 3.6, 3.8,
3.10.4.

python 2.7 works on with version 2.3.10 of markdown2
files
issue2551181 - allow issueXXX#fragment to generate a link with fragment http://hg.code.sf.net:8000/p/roundup/code/#changeset-21c7c2041a4b40ba68f5f58ad4769e2732f83478 John Rouillard rouilj@ieee.org 2021-12-15T23:52:25-05:00 2021-12-15T23:52:25-05:00
changeset 21c7c2041a4b
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551181 - allow issueXXX#fragment to generate a link with fragment

There is another ticket to add id's to elements displaying messages in
issue.item.html. This change allows a fast way to link to such an
element in a long issue with many messages once that other issue is
committed and merged into a tracker template.
files
Add variations on test for _hyper_url functons http://hg.code.sf.net:8000/p/roundup/code/#changeset-f1f8d75edd975a15fbbb2da1c001a430f307f509 John Rouillard rouilj@ieee.org 2021-12-11T17:43:25-05:00 2021-12-11T17:43:25-05:00
changeset f1f8d75edd97
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Add variations on test for _hyper_url functons
files
issue2551132 - Setting form value in query string --- issues http://hg.code.sf.net:8000/p/roundup/code/#changeset-e29d5f4e0af441176b7d988d7c094c3516f2f2c2 John Rouillard rouilj@ieee.org 2021-05-10T16:47:51-04:00 2021-05-10T16:47:51-04:00
changeset e29d5f4e0af4
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551132 - Setting form value in query string --- issues

Code now uses value in query string even if there is a default_value
set. Also handle the exception caused by an invalid value specified
in the query string.
files
issue2551126 - AttributeError: 'str' object has no attribute 'local'. http://hg.code.sf.net:8000/p/roundup/code/#changeset-a7e7314fb7d90fac9942d92a21e6dcee083d67ee John Rouillard rouilj@ieee.org 2021-04-10T22:10:07-04:00 2021-04-10T22:10:07-04:00
changeset a7e7314fb7d9
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551126 - AttributeError: 'str' object has no attribute 'local'.

Fix traceback caused by DateHTMLProperty.pretty() called
on a string value due to error in some other field.
files
Test StringHTMLProperty.wrapped(); test url, plain text for rst http://hg.code.sf.net:8000/p/roundup/code/#changeset-ab18fe956d4515b5665b362f4e9e3928aeec16d6 John Rouillard rouilj@ieee.org 2021-03-12T12:13:25-05:00 2021-03-12T12:13:25-05:00
changeset ab18fe956d45
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Test StringHTMLProperty.wrapped(); test url, plain text for rst
files
Test hyperlinked method on designators http://hg.code.sf.net:8000/p/roundup/code/#changeset-a70a0c138dd9a2dfefd77dee306669d13e1fb6bf John Rouillard rouilj@ieee.org 2021-03-12T02:47:13-05:00 2021-03-12T02:47:13-05:00
changeset a70a0c138dd9
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Test hyperlinked method on designators

Smarter definition of hasnode in mock database.
Designators with id's > 10 will return False from hasnode.
files
Make testing mock smarter. Make getclass fail for invalid classes. http://hg.code.sf.net:8000/p/roundup/code/#changeset-316c2c32dacebd677221a8d3ab14502d1246e067 John Rouillard rouilj@ieee.org 2021-03-12T01:49:38-05:00 2021-03-12T01:49:38-05:00
changeset 316c2c32dace
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Make testing mock smarter. Make getclass fail for invalid classes.
files
issue2551108 - fix markdown formatted designator links http://hg.code.sf.net:8000/p/roundup/code/#changeset-6f89cdc7c938193a0d6e3f26565459f90576012f John Rouillard rouilj@ieee.org 2021-03-12T01:30:22-05:00 2021-03-12T01:30:22-05:00
changeset 6f89cdc7c938
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551108 - fix markdown formatted designator links

Designators like 'issue1' are automatically hyperlinked. However if
typed as [issue1](issue1) or [issue1](https://example.com/issue1) they
get mangled. Stop that mangling.
files
issue2551104 - fix issue with markdown autolink next to punctuation http://hg.code.sf.net:8000/p/roundup/code/#changeset-fd0bdcbc68e42752b95c98353a3b1f08f232dfa6 John Rouillard rouilj@ieee.org 2020-12-20T12:28:59-05:00 2020-12-20T12:28:59-05:00
changeset fd0bdcbc68e4
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551104 - fix issue with markdown autolink next to punctuation

Given:

[label](http://example.com/).

generated href including the ').' This fixes that.
files
issue2551099 - disable processing of data url's in markdown. http://hg.code.sf.net:8000/p/roundup/code/#changeset-3f75383167242faa840d4bc49548f9b250345554 John Rouillard rouilj@ieee.org 2020-10-31T15:43:53-04:00 2020-10-31T15:43:53-04:00
changeset 3f7538316724
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551099 - disable processing of data url's in markdown.

Display as plain text.

Added 'data' to templating.py _disable_url_schemes array. User should
be able to re-enable it by changing the array from the tracker's
interfaces.py. Markdown tests failed before the change to
_disable_url_schemes.

Also add second separate data test for ReST and plain text processing.
data url's look like they are already ignored in these proess streams.
files
issue2551098: markdown links missing rel="noreferer nofollow" http://hg.code.sf.net:8000/p/roundup/code/#changeset-d30501bafdfb25d513aaf26156eb8e93131e355e John Rouillard rouilj@ieee.org 2020-10-31T14:51:16-04:00 2020-10-31T14:51:16-04:00
changeset d30501bafdfb
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551098: markdown links missing rel="noreferer nofollow"

Links generated by all markdown backends are missing the noopener and
nofollow relation that roundup's normal text -> html core adds to
prevent security issues and link spam.

Now rel="nofollow" is added to links generated by markdown2 backends
and rel="nofollow noopener" for mistune and markdown backends.

Markdown2 isn't as programable as the other two backends so I used the
built-in nofollow support. This means that a user that generates a
link that opens in a new window can manpulate the parent window.
files
issue2551096 - enable markdown autolink for email and bare url's. http://hg.code.sf.net:8000/p/roundup/code/#changeset-6ed5152a92d012d185bdbe393e3f810f5df12fdf John Rouillard rouilj@ieee.org 2020-10-29T23:15:31-04:00 2020-10-29T23:15:31-04:00
changeset 6ed5152a92d0
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551096 - enable markdown autolink for email and bare url's.

Modify raw markdown adding appropriate link markers '<' and '>' on the
fly so bare urls and email addreses are recognized as explicit links
by markdown backends. Patch by Cedric Krier.
files
issue2551097 - fix call to markdown2 - fix fenced code blocks. http://hg.code.sf.net:8000/p/roundup/code/#changeset-9ec3a9bc4ea53082a557cdccc71ca46f8344e44f John Rouillard rouilj@ieee.org 2020-10-29T17:08:44-04:00 2020-10-29T17:08:44-04:00
changeset 9ec3a9bc4ea5
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551097 - fix call to markdown2 - fix fenced code blocks.

The invocation of fenced codeblock support in markdown2 was wrong.

With this fixed the code that was used to test markdown processor
exception handling no longer works. Fixed test case to make it pass.

Added new test with invalid markdown that tests markdown exception
handling.

Also renamed test to include markdown. Makes using -k option in
run_tests easier.
files
issue2551094 - markdown mismatch - new config for embedded newine http://hg.code.sf.net:8000/p/roundup/code/#changeset-957a0fc20021ac7e8e68de4a03cc37f81ea205c0 John Rouillard rouilj@ieee.org 2020-10-25T16:12:15-04:00 2020-10-25T16:12:15-04:00
changeset 957a0fc20021
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description issue2551094 - markdown mismatch - new config for embedded newine

Make earlier patch to fix mismatch between simplemde formatting
of embedded newlines choosable. New option MARKDOWN_BREAK_ON_NEWLINE
added to config.ini. If set to true all 4 renders: markdown,
markdown2, mistune and simplemde will make a newline into a hard
linebreak using <br> when displayed.
files
Handle exception raised from markdown processing http://hg.code.sf.net:8000/p/roundup/code/#changeset-bda491248fd8b7f7980946d32a32a56f14f97d2c John Rouillard rouilj@ieee.org 2020-10-22T20:43:29-04:00 2020-10-22T20:43:29-04:00
changeset bda491248fd8
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Handle exception raised from markdown processing

If an exception is raised from the markdown processor, return plain
text to the user.
files
Add test for hard linebreak fomatting in markdown http://hg.code.sf.net:8000/p/roundup/code/#changeset-474de62f4ce039e18d7289722f01fc9693866582 John Rouillard rouilj@ieee.org 2020-10-22T11:49:14-04:00 2020-10-22T11:49:14-04:00
changeset 474de62f4ce0
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Add test for hard linebreak fomatting in markdown

issue2551094 proposes making any newline into a hard linebreak in the
html. This is not markdown standard. Standard is two trailing spaces
on a line followed by newline. Test that all formatters support it.
files
fix test for Python 2 http://hg.code.sf.net:8000/p/roundup/code/#changeset-b108c9fc7aeab8c9eb08093acc58471ff3dc448a Christof Meerwald cmeerw@cmeerw.org 2020-02-28T08:15:51+00:00 2020-02-28T08:15:51+00:00
changeset b108c9fc7aea
branch
bookmark
tag
user Christof Meerwald <cmeerw@cmeerw.org>
description fix test for Python 2
files
don't allow javascript URLs in markdown content http://hg.code.sf.net:8000/p/roundup/code/#changeset-a1fd9551d4164b0b6f0a5741266c8c1c0c46c753 Christof Meerwald cmeerw@cmeerw.org 2020-02-27T21:18:56+00:00 2020-02-27T21:18:56+00:00
changeset a1fd9551d416
branch
bookmark
tag
user Christof Meerwald <cmeerw@cmeerw.org>
description don't allow javascript URLs in markdown content
limit auto-linkification in markdown content to issue links to avoid interference with markdown link syntax
files
url's with javascript scheme should not be links in reST http://hg.code.sf.net:8000/p/roundup/code/#changeset-af16c135fb980e581f72da4b7d0fcb4d3061ba77 John Rouillard rouilj@ieee.org 2020-02-25T22:48:17-05:00 2020-02-25T22:48:17-05:00
changeset af16c135fb98
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description url's with javascript scheme should not be links in reST

A javascript url in a reStructuredText document should not be
displayed as a link. So:

javascript:nastyJavascriptCode

should be displayed as text and not a link.

We do this by stripping the scheme from the schemes array in
docutils.utils.urischemes. We set a property on the
StringHTMLProperty to hold the list of schemes we want to disable so
the user can choose to change it if they want.
files
escape HTML tags in markdown content http://hg.code.sf.net:8000/p/roundup/code/#changeset-55c56ceacb8eb2ffb6128380ab4fade66eaa8fee Christof Meerwald cmeerw@cmeerw.org 2020-02-24T22:20:19+00:00 2020-02-24T22:20:19+00:00
changeset 55c56ceacb8e
branch
bookmark
tag
user Christof Meerwald <cmeerw@cmeerw.org>
description escape HTML tags in markdown content
enabled fenced code blocks for markdown
allow mistune to be used as a markdown parser
test all installed markdown parsers and fallback code
files
Disable rst raw and include directives. http://hg.code.sf.net:8000/p/roundup/code/#changeset-72a281a55a17ed23e756b5552f18b54d130bd4a8 John Rouillard rouilj@ieee.org 2020-02-20T21:38:32-05:00 2020-02-20T21:38:32-05:00
changeset 72a281a55a17
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Disable rst raw and include directives.

reStructuredText has some directives that can include files or pass
raw html to the output.

Create new property so user can enable raw or include directives if
desired. See: https://docutils.sourceforge.io/docs/howto/security.html
for details.
files
added markdown rendering support using either markdown2 or markdown http://hg.code.sf.net:8000/p/roundup/code/#changeset-90a1470edbea2192ea65f1b24dca6dade4cf48fb Christof Meerwald cmeerw@cmeerw.org 2020-02-20T19:30:26+00:00 2020-02-20T19:30:26+00:00
changeset 90a1470edbea
branch
bookmark
tag
user Christof Meerwald <cmeerw@cmeerw.org>
description added markdown rendering support using either markdown2 or markdown
files
If rst missing skip; initial attempt to test structuredtext. http://hg.code.sf.net:8000/p/roundup/code/#changeset-c914b3d8362f183c66117f4b601c85a6e29d46ce John Rouillard rouilj@ieee.org 2020-02-19T22:12:06-05:00 2020-02-19T22:12:06-05:00
changeset c914b3d8362f
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description If rst missing skip; initial attempt to test structuredtext.

Try to set up structured text testing. I can't get StructuredText to
run under python3, but this test passes under python2. Once I get
StructuredText to pass under p3, I'll install StructuredText to ci
and these tests won't be skipped.

Also if import for reStructuredText fails, skip the test rather than
silently passing.
files
fixed ReStructuredText encoding with Python 3 http://hg.code.sf.net:8000/p/roundup/code/#changeset-3ada6a3f48e186452c198245ba49212e6163b956 Christof Meerwald cmeerw@cmeerw.org 2020-02-19T22:47:42+00:00 2020-02-19T22:47:42+00:00
changeset 3ada6a3f48e1
branch
bookmark
tag
user Christof Meerwald <cmeerw@cmeerw.org>
description fixed ReStructuredText encoding with Python 3
files
Different fix for displaying booleans properly in xhtml vs html http://hg.code.sf.net:8000/p/roundup/code/#changeset-f0da02e0ca81f997332f4d3e5d79eff4edb90d9f John Rouillard rouilj@ieee.org 2020-01-17T20:16:07-05:00 2020-01-17T20:16:07-05:00
changeset f0da02e0ca81
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Different fix for displaying booleans properly in xhtml vs html

Needed to fix the tests too.
files
Add test and changelog for html boolean fix. http://hg.code.sf.net:8000/p/roundup/code/#changeset-c475159af6b83e780d96bc50a1d020233baf689a John Rouillard rouilj@ieee.org 2019-12-14T16:23:08-05:00 2019-12-14T16:23:08-05:00
changeset c475159af6b8
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Add test and changelog for html boolean fix.
files
Add reverse option to hyperdb property wrapper by David Sowder http://hg.code.sf.net:8000/p/roundup/code/#changeset-c3728772c594d0eeeccd50d1bf1f35a02a37c4da John Rouillard rouilj@ieee.org 2019-10-07T16:30:47-04:00 2019-10-07T16:30:47-04:00
changeset c3728772c594
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Add reverse option to hyperdb property wrapper by David Sowder

issue2551013: Reversed sorting in hyperdb property wrapper object's
sorted() method. Patch by David Sowder, application and doc change
by John Rouillard.
files
Make comment block raw to avoid travis ci warning on \d in comment block. http://hg.code.sf.net:8000/p/roundup/code/#changeset-fe35a232c6dccfcefb322c355cdc59314fcbb61a John Rouillard rouilj@ieee.org 2019-06-14T21:47:22-04:00 2019-06-14T21:47:22-04:00
changeset fe35a232c6dc
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Make comment block raw to avoid travis ci warning on \d in comment block.
files
More invalid escape sequence fixes. http://hg.code.sf.net:8000/p/roundup/code/#changeset-7d276bb8b46d45ce0188084cf86444388c73af9a John Rouillard rouilj@ieee.org 2019-06-12T21:32:46-04:00 2019-06-12T21:32:46-04:00
changeset 7d276bb8b46d
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description More invalid escape sequence fixes.
files
replace assertNotEquals with assertNotEqual http://hg.code.sf.net:8000/p/roundup/code/#changeset-10747e4e4ec4a2e208600e523c5d99e7b66f81db John Rouillard rouilj@ieee.org 2019-06-10T21:28:51-04:00 2019-06-10T21:28:51-04:00
changeset 10747e4e4ec4
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description replace assertNotEquals with assertNotEqual
files
replace assertEquals wth assertEqual. http://hg.code.sf.net:8000/p/roundup/code/#changeset-6aad7b194e63044f9eb9c46287ed3edb5fd97422 John Rouillard rouilj@ieee.org 2019-06-10T21:24:28-04:00 2019-06-10T21:24:28-04:00
changeset 6aad7b194e63
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description replace assertEquals wth assertEqual.
files