• 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/view.py
1
##############################################################################
2
#
3
# Copyright (c) 2006 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 zope.formlib import form
1✔
16

17
from five.formlib.formbase import AddForm
1✔
18
from five.formlib.formbase import EditForm
1✔
19
from five.formlib.tests.content import Content
1✔
20
from five.formlib.tests.content import IContent
1✔
21

22

23
class AddContentForm(AddForm):
1✔
24
    """AddForm for creating and adding IContent objects
25
    """
26

27
    form_fields = form.Fields(IContent)
1✔
28

29
    def createAndAdd(self, data):
1✔
30
        id = data.get('id')
1✔
31
        ctnt = Content(
1✔
32
            id, data.get('title'), somelist=data.get('somelist'))
33
        self.context._setObject(id, ctnt)
1✔
34

35

36
class EditContentForm(EditForm):
1✔
37
    """EditForm for editing IContent objects
38
    """
39

40
    form_fields = form.Fields(IContent)
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