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

zopefoundation / five.formlib / 16399733854

15 Feb 2025 02:34PM UTC coverage: 83.302%. Remained the same
16399733854

push

github

icemac
Back to development: 5.1

49 of 92 branches covered (53.26%)

Branch coverage included in aggregate %.

390 of 435 relevant lines covered (89.66%)

0.9 hits per line

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

100.0
/src/five/formlib/tests/content.py
1
##############################################################################
2
#
3
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
4
# All Rights Reserved.
5
#
6
# This software is subject to the provisions of the Zope Public License,
7
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
8
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11
# FOR A PARTICULAR PURPOSE.
12
#
13
##############################################################################
14

15
from AccessControl.class_init import InitializeClass
1✔
16
from OFS.SimpleItem import SimpleItem
1✔
17
from zope.i18nmessageid import MessageFactory
1✔
18
from zope.interface import Interface
1✔
19
from zope.interface import implementer
1✔
20
from zope.schema import ASCIILine
1✔
21
from zope.schema import List
1✔
22
from zope.schema import TextLine
1✔
23

24

25
_ = MessageFactory('formtest')
1✔
26

27

28
class IContent(Interface):
1✔
29

30
    id = ASCIILine(
1✔
31
        title=_("Id"),
32
        description=_("The object id."),
33
        default='',
34
        required=True
35
    )
36

37
    title = TextLine(
1✔
38
        title=_("Title"),
39
        description=_("A short description of the event."),
40
        default="",
41
        required=True
42
    )
43

44
    somelist = List(
1✔
45
        title=_("Some List"),
46
        value_type=TextLine(title=_("Some item")),
47
        default=[],
48
        required=False
49
    )
50

51

52
@implementer(IContent)
1✔
53
class Content(SimpleItem):
1✔
54
    """A Viewable piece of content with fields
55
    """
56

57
    meta_type = 'Five Formlib Test Content'
1✔
58

59
    def __init__(self, id, title, somelist=None):
1✔
60
        self.id = id
1✔
61
        self.title = title
1✔
62
        self.somelist = somelist
1✔
63

64

65
InitializeClass(Content)
1✔
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