cherrypy-foundation 1.0.0a7__py3-none-any.whl → 1.0.0a8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -63,7 +63,7 @@ def error_page(status='', message='', traceback='', version=''):
63
63
  )
64
64
 
65
65
  # Replace message by generic one for 404. Default implementation leak path info.
66
- if status == '404 Not Found':
66
+ if status == '404 Not Found' and cherrypy.serving.request.path_info in message:
67
67
  message = 'Nothing matches the given URI'
68
68
 
69
69
  # Check expected response type.
@@ -29,6 +29,10 @@ class Root:
29
29
 
30
30
  @cherrypy.expose
31
31
  def not_found(self):
32
+ raise cherrypy.NotFound()
33
+
34
+ @cherrypy.expose
35
+ def not_found_custom(self):
32
36
  raise cherrypy.HTTPError(404, message='My error message')
33
37
 
34
38
  @cherrypy.expose
@@ -60,6 +64,8 @@ class ErrorPageTest(helper.CPWebCase):
60
64
 
61
65
  @parameterized.expand(
62
66
  [
67
+ ('/not_found', '<p>Nothing matches the given URI</p>'),
68
+ ('/not_found_custom', '<p>My error message</p>'),
63
69
  ('/html_error', '<p>My error message</p>'),
64
70
  ('/json_error', '{"message": "json error message", "status": "400 Bad Request"}'),
65
71
  ('/text_error', 'text error message'),
@@ -57,6 +57,5 @@ class FormTest(helper.CPWebCase):
57
57
  self.assertStatus(200)
58
58
  # Then page display the message.
59
59
  self.assertInBody('test-flash')
60
- self.assertInBody('<div class="mb-2 flash-messages" style="min-height:100px">')
61
60
  self.assertInBody('<div class="alert alert-info alert-dismissible fade show"')
62
61
  self.assertInBody('default flash message')
@@ -109,8 +109,8 @@ class FormTest(helper.CPWebCase):
109
109
  '<input class="form-check-input" container-class="col-sm-6" id="persistent" label-attr="FOO" name="persistent" type="checkbox" value="y">'
110
110
  )
111
111
  self.assertInBody('<label attr="FOO" class="form-check-label" for="persistent">Remember me</label>')
112
- # 5. check submit button
113
- self.assertInBody('<div attr="BAR" class="mb-2 form-field col-sm-6">')
114
- self.assertInBody(
115
- '<input class="btn-primary float-end btn" container-attr="BAR" container-class="col-sm-6" id="submit" name="submit" type="submit" value="Login">'
112
+ # 5. check submit button (regex matches because class could have different order with jinjax<=0.57)
113
+ self.assertInBody('<div attr="BAR"')
114
+ self.assertMatchesBody(
115
+ '<input class="(btn-primary ?|float-end ?|btn ?){3}" container-attr="BAR" container-class="col-sm-6" id="submit" name="submit" type="submit" value="Login">'
116
116
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cherrypy-foundation
3
- Version: 1.0.0a7
3
+ Version: 1.0.0a8
4
4
  Summary: CherryPy Foundation
5
5
  Author-email: Patrik Dufresne <patrik@ikus-soft.com>
6
6
  License: GPLv3
@@ -1,5 +1,5 @@
1
1
  cherrypy_foundation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- cherrypy_foundation/error_page.py,sha256=Mz47u6n4eqQ85LKT9lWglqPPtmizikY9xBsrhGl7_nI,3198
2
+ cherrypy_foundation/error_page.py,sha256=rAFr4Oc_xjIQn7sQbng5Z0r-bgqy8T3LwtCa2tv7M3A,3248
3
3
  cherrypy_foundation/flash.py,sha256=fFRbutUX6c1lVHqjehmO9y98dJgmfNCjhd76t2mth2s,1542
4
4
  cherrypy_foundation/form.py,sha256=8c9dO0o47sK3CBosTkGXoVRtzNQwY0aw0vNZfTqmhvo,3994
5
5
  cherrypy_foundation/logging.py,sha256=YIOK5ZAZLCv52YDdP66yBYpEX1C336JnI3wnrTKl1Lw,3468
@@ -91,9 +91,9 @@ cherrypy_foundation/plugins/tests/test_ldap.py,sha256=7EhFvhxwDCCBoNlAD5XpZxLtKv
91
91
  cherrypy_foundation/plugins/tests/test_scheduler.py,sha256=I-ZuQhMvCCvqFDwukwsyz_UkdJJ8JSLTkAanUo24GCE,3564
92
92
  cherrypy_foundation/plugins/tests/test_smtp.py,sha256=qs5yezIpSXkBmLmFlqckfPW7NmntHZxQjDSkdQG_dNE,4183
93
93
  cherrypy_foundation/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
94
- cherrypy_foundation/tests/test_error_page.py,sha256=8u5p6lv_I4XvfGipjJXNFwW7G1N8AK8IOnc_Th-Ebto,2181
95
- cherrypy_foundation/tests/test_flash.py,sha256=OMoEKy4xaYT75OZ4bdL3Vb3jDRBNP_Wr3BaVAlkO9V4,2064
96
- cherrypy_foundation/tests/test_form.py,sha256=KvVA7OEqaDR-A-1EJdA-WlXkqyK9YJkRHhoUvGx1zr8,4269
94
+ cherrypy_foundation/tests/test_error_page.py,sha256=8yLK8OGbJIdUjilFIHMNBZadLKHrXnD6KSmQ3Da4LaQ,2399
95
+ cherrypy_foundation/tests/test_flash.py,sha256=JqZDAgazlNnP3HcPFmFOWbPeDDMzc6z5fHNe-pBTin0,1976
96
+ cherrypy_foundation/tests/test_form.py,sha256=sWsPWyXwAVkCeP5t0qIHc0Oi32Zi3kztoQ_wlDR9STc,4326
97
97
  cherrypy_foundation/tests/test_passwd.py,sha256=gC5O4yhHyU1YRYuDc0pG0T_5zvrG2qrr6P822iyK3Rg,1956
98
98
  cherrypy_foundation/tests/test_url.py,sha256=W-RTKQuxYS2KXxCYTTtnKcxfdP9F6Fp3QKY_sBTnBmE,6434
99
99
  cherrypy_foundation/tests/templates/test_flash.html,sha256=MyOPsHQX97TB30sbKrbG3tagKDyvV8OVKp-UOrw7REc,187
@@ -123,8 +123,8 @@ cherrypy_foundation/tools/tests/locales/fr/LC_MESSAGES/messages.po,sha256=6_Sk9I
123
123
  cherrypy_foundation/tools/tests/templates/test_jinja2.html,sha256=v9AHxksbBvzE7sesPqE61HMhsvU4juXt3E0ZQo-zXVQ,190
124
124
  cherrypy_foundation/tools/tests/templates/test_jinja2_i18n.html,sha256=98S51dgG7Vb4rvMZNZvomw1D9pBiM4g6pdlxAgvrxXA,373
125
125
  cherrypy_foundation/tools/tests/templates/test_jinjax.html,sha256=NT19UaUzm8FRKOIc6H6HNGPDJU6KATnakd8zf3BCeAs,153
126
- cherrypy_foundation-1.0.0a7.dist-info/licenses/LICENSE.md,sha256=trSLYs5qlaow_bBwsLTRKpmTXsXzFksM_YUCMqrgAJQ,35149
127
- cherrypy_foundation-1.0.0a7.dist-info/METADATA,sha256=ijef0IFNw9vsQRxuexXc07h4_OWHPgIIQSmj5FQDY-w,2022
128
- cherrypy_foundation-1.0.0a7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
129
- cherrypy_foundation-1.0.0a7.dist-info/top_level.txt,sha256=B1vQPTLYhpKJ6W0JkRCWyAf8RPcnwJWdYxixv75-4ew,20
130
- cherrypy_foundation-1.0.0a7.dist-info/RECORD,,
126
+ cherrypy_foundation-1.0.0a8.dist-info/licenses/LICENSE.md,sha256=trSLYs5qlaow_bBwsLTRKpmTXsXzFksM_YUCMqrgAJQ,35149
127
+ cherrypy_foundation-1.0.0a8.dist-info/METADATA,sha256=7aXt2rwg_HACqXWiWHeFxkJN0wrVNWylVJZbf9M-L-8,2022
128
+ cherrypy_foundation-1.0.0a8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
129
+ cherrypy_foundation-1.0.0a8.dist-info/top_level.txt,sha256=B1vQPTLYhpKJ6W0JkRCWyAf8RPcnwJWdYxixv75-4ew,20
130
+ cherrypy_foundation-1.0.0a8.dist-info/RECORD,,