diff --git a/openatlas/display/util.py b/openatlas/display/util.py index c8ca7c88b..f498dbb9e 100644 --- a/openatlas/display/util.py +++ b/openatlas/display/util.py @@ -486,13 +486,11 @@ def link( html = link( object_.code, url_for('cidoc_class_view', code=object_.code), - uc_first_=False, external=external) elif isinstance(object_, CidocProperty): html = link( object_.code, url_for('property_view', code=object_.code), - uc_first_=False, external=external) elif isinstance(object_, Project): html = link( diff --git a/openatlas/views/changelog.py b/openatlas/views/changelog.py index 8d1e64431..850c75b5d 100644 --- a/openatlas/views/changelog.py +++ b/openatlas/views/changelog.py @@ -2,7 +2,6 @@ from flask_babel import lazy_gettext as _ from openatlas import app -from openatlas.display.util import link @app.route('/changelog') @@ -1012,9 +1011,5 @@ def index_changelog() -> str: '318': 'Import definitions from CIDOC rdfs'}}], '0.0.1': ['2014-11-05', { 'feature': { - '': 'Initial version based on the Zend Base project from ' + - link( - 'craws.net', - 'https://craws.net', - uc_first_=False, - external=True)}}]} + '': 'Initial version based on the Zend Base project from craws.net' + }}]} diff --git a/openatlas/views/user.py b/openatlas/views/user.py index 10f03ce54..f912f98c4 100644 --- a/openatlas/views/user.py +++ b/openatlas/views/user.py @@ -138,12 +138,9 @@ def user_view(id_: int) -> str: user = User.get_by_id(id_) if not user: abort(404) - created_count = '' - if count := User.get_created_entities_count(user.id): - created_count = link( - format_number(count), - url_for("user_entities", id_=user.id), - uc_first_=False) + count = '' + if x := User.get_created_entities_count(user.id): + count = link(format_number(x), url_for("user_entities", id_=user.id)) info = { _('username'): user.username, _('group'): user.group, @@ -151,7 +148,7 @@ def user_view(id_: int) -> str: _('email'): user.email if is_authorized('manager') or user.settings['show_email'] else '', - _('created entities'): created_count, + _('created entities'): count, _('activity'): link(_('log'), url_for('user_activity', user_id=user.id)), _('language'): user.settings['language'], diff --git a/tests/test_file.py b/tests/test_file.py index a12c24da1..a583a625f 100644 --- a/tests/test_file.py +++ b/tests/test_file.py @@ -21,7 +21,6 @@ def test_file(self) -> None: logo = Path( app.root_path) / 'static' / 'images' / 'layout' / 'logo.png' - with open(logo, 'rb') as img_1, open(logo, 'rb') as img_2: rv: Any = self.app.post( url_for('insert', class_='file', origin_id=place.id), @@ -172,8 +171,7 @@ def test_file(self) -> None: rv = self.app.get(url_for('view', id_=iiif_id)) assert b'View in IIIF' in rv.data - rv = self.app.get( - url_for('view', id_=place.id, _anchor="tab-file")) + rv = self.app.get(url_for('view', id_=place.id)) assert b'view all IIIF images' in rv.data with app.test_request_context(): @@ -206,9 +204,11 @@ def test_file(self) -> None: rv = self.app.get(url_for('api.licensed_file_overview')) assert bool(len(rv.get_json().keys()) == 4) + rv = self.app.get( url_for('api.licensed_file_overview', download=True)) assert bool(len(rv.get_json().keys()) == 4) + rv = self.app.get( url_for('api.licensed_file_overview', file_id=iiif_id)) assert bool(len(rv.get_json().keys()) == 1) @@ -234,9 +234,7 @@ def test_file(self) -> None: follow_redirects=True) assert b'An interesting annotation' in rv.data - rv = self.app.get(url_for( - 'view_iiif', - id_=iiif_id)) + rv = self.app.get(url_for('view_iiif', id_=iiif_id)) assert b'Mirador' in rv.data rv = self.app.get( @@ -266,9 +264,10 @@ def test_file(self) -> None: assert bool(str(iiif_id) in json['@id']) annotation_id = json['resources'][0]['@id'].rsplit('/', 1)[-1] - rv = self.app.get(url_for( - 'api.iiif_annotation', - annotation_id=annotation_id.replace('.json', ''))) + rv = self.app.get( + url_for( + 'api.iiif_annotation', + annotation_id=annotation_id.replace('.json', ''))) assert bool(annotation_id in rv.get_json()['@id']) with app.test_request_context(): @@ -289,10 +288,11 @@ def test_file(self) -> None: app.preprocess_request() iiif_file.delete_links(['P67']) - rv = self.app.get(url_for( - 'admin_annotation_remove_entity', - annotation_id=1, - entity_id=place.id), + rv = self.app.get( + url_for( + 'admin_annotation_remove_entity', + annotation_id=1, + entity_id=place.id), follow_redirects=True) assert b'Entity removed from annotation' in rv.data