Skip to content

Commit

Permalink
fix python tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lenadax committed Feb 3, 2025
1 parent 4f504fe commit 493613c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/cone/app/tests/test_browser_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def test_ActionView(self):
...<a
id="toolbaraction-view"
href="http://example.com/root/model"
class="selected"
class="active"
ajax:bind="click"
ajax:target="http://example.com/root/model"
ajax:action="content:#content:inner"
Expand Down Expand Up @@ -433,7 +433,7 @@ def test_ViewLink(self):
...<a
id="toolbaraction-view"
href="http://example.com/root/model"
class="selected"
class="active"
ajax:bind="click"
ajax:target="http://example.com/root/model"
ajax:action="content:#content:inner"
Expand Down
4 changes: 2 additions & 2 deletions src/cone/app/tests/test_browser_contextmenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ class MyLinkAction(LinkAction):
cmt = ContextMenuToolbar()
cmt['link'] = MyLinkAction()
self.assertTrue(cmt(model, request).find('My Action') > -1)
self.assertFalse(cmt(model, request).find('class="selected"') > -1)
self.assertFalse(cmt(model, request).find('class="active"') > -1)

cmt['link'].selected = True
self.assertTrue(cmt(model, request).find('class="selected"') > -1)
self.assertTrue(cmt(model, request).find('class="active"') > -1)

cmt.css = 'mytoolbar'
expected = 'class="mytoolbar"'
Expand Down
11 changes: 7 additions & 4 deletions src/cone/app/tests/test_browser_referencebrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ class TestBrowserReferenceBrowser(TileTestCase):
def test_reference_render(self):
self.layer.new_request()
widget = factory('reference', name='ref')

self.checkOutput("""
<span
ajax:target="http://example.com/?navigable=&referencable=&root=/&selected=">
ajax:target="http://example.com/?navigable=&referencable=&root=/&selected="
class="input-group">
<input class="form-control referencebrowser"
id="input-ref" name="ref" readonly="readonly"
type="text" value="" />
<input name="ref.uid" type="hidden" value="" />
<span class="referencebrowser_trigger" data-reference-name='ref'>
<span class="referencebrowser_trigger input-group-text" data-reference-name='ref'>
<i class="bi-link">
</i>
browse</span>
Expand All @@ -49,12 +51,13 @@ def test_reference_render(self):
widget.attrs['multivalued'] = True
self.checkOutput("""
<span
ajax:target="http://example.com/?navigable=&referencable=&root=/&selected=">
ajax:target="http://example.com/?navigable=&referencable=&root=/&selected="
class="">
<input id="exists-ref" name="ref-exists" type="hidden" value="exists" />
<select class="form-control referencebrowser"
id="input-ref" multiple="multiple" name="ref">
</select>
<span class="referencebrowser_trigger" data-reference-name='ref'>
<span class="referencebrowser_trigger input-group-text" data-reference-name='ref'>
<i class="bi-link">
</i>
browse</span>
Expand Down
3 changes: 2 additions & 1 deletion src/cone/app/tests/test_browser_sharing.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ def test_render_sharing_tile(self):
# Render sharing tile
with self.layer.authenticated('manager'):
res = render_tile(root, request, 'sharing')

self.checkOutput("""
...<table class="table table-striped mb-1 scrollable-content"
...<table class="table table-striped mb-0 scrollable-content"
id="localacltable_table">...
""", res)

Expand Down
6 changes: 3 additions & 3 deletions src/cone/app/tests/test_browser_translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def test_translation_edit_renderer_no_value(self):
})

self.checkOutput("""
<div class="field" id="field-field">
<div class="field mb-2" id="field-field">
<ul class="nav nav-pills mb-2 translation-nav">
<li class="nav-item">
<a class="nav-link py-0 active" href="#translation-field-en">EN</a>
Expand Down Expand Up @@ -291,7 +291,7 @@ def test_required(self):
request.params['field.de'] = u'Value DE'
data = widget.extract(request)
self.checkOutput("""
<div class="field" id="field-field">
<div class="field mb-2" id="field-field">
<ul class="nav nav-pills mb-2 translation-nav">
<li class="nav-item error">
<a class="nav-link py-0 active" href="#translation-field-en">* EN</a>
Expand Down Expand Up @@ -326,7 +326,7 @@ def test_translation_display_renderer(self):
mode='display')

self.checkOutput("""
<div class="field" id="field-field">
<div class="field mb-2" id="field-field">
<ul class="nav nav-pills mb-2 translation-nav">
<li class="nav-item">
<a class="nav-link py-0 active" href="#translation-field-en">EN</a>
Expand Down

0 comments on commit 493613c

Please sign in to comment.