Exemple #1
0
    def test__widget__(self):
        rendered = self.base.__widget__()
        assert_in_xml("""<td class="fieldcol" >
                <select name="town" class="propertysingleselectfield" id="town">
        <option value="" selected="selected">-----------</option>
</select>
            </td>""", rendered)
Exemple #2
0
    def test_entity_with_dropdown_field_names_title_overridden(self):
        class GroupFormFieldNames(FormBase):
            __entity__ = Group
            __dropdown_field_names__ = {'users':'user_name'}
        form = GroupFormFieldNames(session)
        rendered = form()
        assert_in_xml("""<select name="users" class="propertymultipleselectfield" id="users" multiple="multiple" size="5">
        <option value="1">asdf</option>
</select>""", rendered)
Exemple #3
0
 def test__widget__(self):
     rendered = self.base.__widget__()
     assert_in_xml( """<tr class="even" id="user_name.container" title="" >
         <td class="labelcol">
             <label id="user_name.label" for="user_name" class="fieldlabel">User Name</label>
         </td>
         <td class="fieldcol" >
             <input type="text" id="user_name" class="textfield" name="user_name" value="" disabled="disabled" />
         </td>
     </tr>""", rendered)
Exemple #4
0
 def test__widget__(self):
     rendered = self.base.__widget__()
     assert_in_xml("""<tr class="even" id="submit.container" title="" >
         <td class="labelcol">
             <label id="submit.label" for="submit" class="fieldlabel"></label>
         </td>
         <td class="fieldcol" >
             <input type="submit" class="submitbutton" value="Submit" />
         </td>
     </tr>""", rendered)
Exemple #5
0
 def test_entity_with_synonym(self):
     class DocumentForm(FormBase):
         __entity__ = Document
     form = DocumentForm(session)
     rendered = form()
     assert_in_xml("""<tr class="odd" id="address.container" title="" >
         <td class="labelcol">
             <label id="address.label" for="address" class="fieldlabel">Address</label>
         </td>
         <td class="fieldcol" >
             <input type="text" id="address" class="textfield" name="address" value="" />
         </td>
     </tr>""", rendered)
Exemple #6
0
    def test_entity_with_dropdown_field_names_dict(self):
        class UserFormFieldNames(FormBase):
            __entity__ = User
            __dropdown_field_names__ = {'groups':['group_name']}
        form = UserFormFieldNames(session)
        rendered = form()
        assert_in_xml( """<td class="fieldcol" >
                <select name="groups" class="propertymultipleselectfield" id="groups" multiple="multiple" size="5">
        <option value="1">0</option>
        <option value="2">1</option>
        <option value="3">2</option>
        <option value="4">3</option>
        <option value="5">4</option>
</select>
            </td>""", rendered)
        def test__widget__(self):
            rendered = self.base.__widget__()
            assert_in_xml("""<table  dojoType="dojox.grid.DataGrid" jsId="None" id="None" store="None_store" columnReordering="false" rowsPerPage="20" model="None" delayScroll="true" autoHeight="None" class="sprox-dojo-grid" escapeHTMLInData="False" >
    <thead>
            <tr>
                    <th formatter="lessThan" width="10em" field="__actions__"                             editable="true">actions</th>
                    <th formatter="lessThan" width="10em" field="_password"                             editable="true">_password</th>
                    <th formatter="lessThan" width="10em" field="user_id"                             editable="true">user_id</th>
                    <th formatter="lessThan" width="10em" field="user_name"                             editable="true">user_name</th>
                    <th formatter="lessThan" width="10em" field="email_address"                             editable="true">email_address</th>
                    <th formatter="lessThan" width="10em" field="display_name"                             editable="true">display_name</th>
                    <th formatter="lessThan" width="10em" field="created"                             editable="true">created</th>
                    <th formatter="lessThan" width="10em" field="town_id"                             editable="true">town_id</th>
                    <th formatter="lessThan" width="10em" field="town"                             editable="true">town</th>
                    <th formatter="lessThan" width="10em" field="password"                             editable="true">password</th>
                    <th formatter="lessThan" width="10em" field="groups"                             editable="true">groups</th>
            </tr>
    </thead>
</table>""", rendered)