Skip to content

Commit

Permalink
doctests got back in place, skipping only one with exceptions due to …
Browse files Browse the repository at this point in the history
…Py3 vs Py2 tracebacks
  • Loading branch information
amol- committed Jul 27, 2015
1 parent 9c6b99c commit 2c10362
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 35 deletions.
3 changes: 3 additions & 0 deletions sprox/entitiesbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ class EntitiesBase(ViewBase):
>>> base = MyEntitiesBase(session, metadata=metadata)
>>> print(base())
<div class="containerwidget">
<div class="entitylabelwidget" id="sx_CompoundPrimaryKey">
<a href="CompoundPrimaryKey/">CompoundPrimaryKey</a>
</div>
<div class="entitylabelwidget" id="sx_Department">
<a href="Department/">Department</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion sprox/formbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class FormBase(ViewBase):
... __limit_fields__ = ['town']
... __require_fields__ = ['town']
>>> town_form = UserOnlyTownForm(session)
>>> town_form.validate(params={'sprox_id':1})
>>> town_form.validate(params={'sprox_id':1}) # doctest: +SKIP
Traceback (most recent call last):
...
ValidationError
Expand Down
2 changes: 1 addition & 1 deletion sprox/recordviewbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class RecordViewBase(ViewBase):
<td>
<b>display_name</b>
</td>
<td>
<td> Asd Sdf
</td>
</tr>
<tr class="recordfieldwidget" id="sx_town_id">
Expand Down
86 changes: 54 additions & 32 deletions sprox/tablebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class TableBase(ViewBase):
<th class="col_0">actions</th>
<th class="col_1">town_id</th>
<th class="col_2">name</th>
<th class="col_3">residents</th>
</tr>
</thead>
<tbody>
Expand All @@ -88,41 +89,51 @@ class TableBase(ViewBase):
<tr>
<th class="col_0">town_id</th>
<th class="col_1">name</th>
<th class="col_2">residents</th>
</tr>
</thead>
<tbody>
<tr class="even">
<td class="col_0">
1
</td>
<td class="col_1">
Arvada
</td>
</tr>
<tr class="odd">
<td class="col_0">
2
</td>
<td class="col_1">
Denver
</td>
</tr>
<tr class="even">
<td class="col_0">
3
</td>
<td class="col_1">
Golden
</td>
</tr>
<tr class="odd">
<td class="col_0">
4
</td>
<td class="col_1">
Boulder
</td>
</tr>
<tr class="even">
<td class="col_0">
1
</td>
<td class="col_1">
Arvada
</td>
<td class="col_2">
asdf@asdf.com
</td>
</tr>
<tr class="odd">
<td class="col_0">
2
</td>
<td class="col_1">
Denver
</td>
<td class="col_2">
</td>
</tr>
<tr class="even">
<td class="col_0">
3
</td>
<td class="col_1">
Golden
</td>
<td class="col_2">
</td>
</tr>
<tr class="odd">
<td class="col_0">
4
</td>
<td class="col_1">
Boulder
</td>
<td class="col_2">
</td>
</tr>
</tbody>
</table>
</div>
Expand All @@ -141,6 +152,7 @@ class TableBase(ViewBase):
<tr>
<th class="col_0">town_id</th>
<th class="col_1">name</th>
<th class="col_2">residents</th>
</tr>
</thead>
<tbody>
Expand All @@ -151,6 +163,9 @@ class TableBase(ViewBase):
<td class="col_1">
Arvada
</td>
<td class="col_2">
asdf@asdf.com
</td>
</tr>
<tr class="odd">
<td class="col_0">
Expand All @@ -159,6 +174,8 @@ class TableBase(ViewBase):
<td class="col_1">
Denver
</td>
<td class="col_2">
</td>
</tr>
<tr class="even">
<td class="col_0">
Expand All @@ -167,6 +184,8 @@ class TableBase(ViewBase):
<td class="col_1">
Golden
</td>
<td class="col_2">
</td>
</tr>
<tr class="odd">
<td class="col_0">
Expand All @@ -175,11 +194,14 @@ class TableBase(ViewBase):
<td class="col_1">
Boulder
</td>
<td class="col_2">
</td>
</tr>
</tbody>
</table>
</div>
"""

#object overrides
Expand Down
4 changes: 3 additions & 1 deletion tests/test_doctests.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,6 @@ def tearDown(self):
suite.addTest(doctest.DocTestSuite(dojo_formbase, globs={'session':session, 'User': User, 'Town':Town, 'metadata':metadata}, setUp=setUp, tearDown=tearDown))

runner = unittest.TextTestRunner(verbosity=10)
runner.run(suite)
result = runner.run(suite)
assert not result.failures, '%s Failues in DOCTESTS' % len(result.failures)
assert not result.errors, '%s Errors in DOCTESTS' % len(result.errors)

0 comments on commit 2c10362

Please sign in to comment.