3737from tests .support import MIG_BASE , PY2 , TEST_DATA_DIR , MigTestCase , testmain , \
3838 temppath , ensure_dirs_exist
3939from tests .support .fixturesupp import FixtureAssertMixin
40+ from tests .support .snapshotsupp import SnapshotAssertMixin
4041from tests .support .templatesupp import arrange_use_of_test_templates
4142from tests .support .wsgisupp import WsgiAssertMixin , create_wsgi_environ
4243
@@ -198,7 +199,8 @@ def test_test_test_test(self):
198199
199200class MigSharedFunctionalityTmplinterface__end_to_end (MigTestCase ,
200201 WsgiAssertMixin ,
201- FixtureAssertMixin ):
202+ FixtureAssertMixin ,
203+ SnapshotAssertMixin ):
202204 """Tests of the end to end usage of jsoninterface"""
203205
204206 TEST_CLIENT_ID = '/C=DK/ST=NA/L=NA/O=Test Org/OU=NA/CN=Test User/emailAddress=test@example.com'
@@ -239,20 +241,7 @@ def test_responds_with_accepted_for_content_type_form_data(self):
239241 expected_content_type = 'text/html' )
240242
241243 content_trimmed = _trim_ends_of_lines (content )
242- self .assertEqual (content_trimmed , """<table>
243-
244- <tr>
245- <td>
246- <input type="hidden" name="peers" value="/C=DK/ST=NA/L=NA/O=Test Org/OU=NA/CN=Test User/emailAddress=peer@example.com" data-bind-observe="peer_dn">
247- <input type="checkbox" data-bind-checked="selected">
248- </td>
249-
250- <td>peer@example.com</td>
251-
252- <td></td>
253- </tr>
254-
255- </table>""" )
244+ self .assertSnapshot (content_trimmed , extension = 'html' )
256245
257246 def test_responds_with_requested_for_content_type_form_data (self ):
258247 arrange_use_of_test_templates (self , base_packages = ['migux' ])
@@ -275,20 +264,7 @@ def test_responds_with_requested_for_content_type_form_data(self):
275264 expected_content_type = 'text/html' )
276265
277266 content_trimmed = _trim_ends_of_lines (content )
278- self .assertEqual (content_trimmed , """<table>
279-
280- <tr>
281- <td>
282- <input type="hidden" name="peers" value="/C=DK/ST=NA/L=NA/O=Test Org/OU=NA/CN=Pending Peer User/emailAddress=pending_peer@example.com" data-bind-observe="peer_dn">
283- <input type="checkbox" data-bind-checked="selected">
284- </td>
285-
286- <td>pending_peer@example.com</td>
287-
288- <td></td>
289- </tr>
290-
291- </table>""" )
267+ self .assertSnapshot (content_trimmed , extension = 'html' )
292268
293269
294270if __name__ == '__main__' :
0 commit comments