• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zopefoundation / grokcore.viewlet / 5776423262

pending completion
5776423262

push

github

web-flow
Config with pure python template (#7)

* Drop support for Python 2.7, 3.5, 3.6.

46 of 54 branches covered (85.19%)

Branch coverage included in aggregate %.

81 of 81 new or added lines in 21 files covered. (100.0%)

580 of 604 relevant lines covered (96.03%)

0.96 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.0
/src/grokcore/viewlet/tests/base/viewlet/viewlet_render_and_template.py
1
"""
2
A viewlet is not allowed to define its own render method and have a template
3
associated with it at the same time.
4

5
  >>> grok.testing.grok(__name__)
6
  Traceback (most recent call last):
7
    ...
8
  zope.configuration.config.ConfigurationExecutionError: \
9
  martian.error.GrokError: Multiple possible ways to render viewlet \
10
  <class \
11
  'grokcore.viewlet.tests.base.viewlet.viewlet_render_and_template.Viewlet'>. \
12
  It has both a 'render' method as well as an associated template.
13

14
"""
15

16
from zope.interface import Interface
1✔
17

18
import grokcore.viewlet as grok
1✔
19

20

21
class ViewletManager(grok.ViewletManager):
1✔
22
    grok.name('foo')
1✔
23
    grok.context(Interface)
1✔
24

25

26
class Viewlet(grok.Viewlet):
1✔
27
    grok.viewletmanager(ViewletManager)
1✔
28
    grok.context(Interface)
1✔
29

30
    def render(self):
1✔
31
        return "Render method but also a template!"
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc