X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=blobdiff_plain;f=htsworkflow%2Ffrontend%2Fsamples%2Ftests.py;h=bfe4b0e2c7260c6a5f18893c72c93708f80fde11;hp=daabc11fe9f9289b4055cb13395565d61bae3dae;hb=89c191828b16e8385685eb7ef18f82bc751e5b3b;hpb=40d2e0eb1ad3612f18c0543bfa5950f89ac749f1 diff --git a/htsworkflow/frontend/samples/tests.py b/htsworkflow/frontend/samples/tests.py index daabc11..bfe4b0e 100644 --- a/htsworkflow/frontend/samples/tests.py +++ b/htsworkflow/frontend/samples/tests.py @@ -20,7 +20,7 @@ from htsworkflow.frontend.samples.views import \ from htsworkflow.frontend.auth import apidata from htsworkflow.util.conversion import unicode_or_none - +from htsworkflow.util.ethelp import validate_xhtml class LibraryTestCase(TestCase): fixtures = ['test_samples.json'] @@ -149,7 +149,8 @@ class SampleWebTestCase(TestCase): response = self.client.get('/library/10981/') self.assertEqual(response.status_code, 200) - load_string_into_model(model, 'rdfa', response.content) + content = response.content + load_string_into_model(model, 'rdfa', content) body = """prefix rdf: prefix libns: @@ -170,6 +171,9 @@ class SampleWebTestCase(TestCase): self.assertEqual(fromTypedNode(r['gel_cut']), 400) self.assertEqual(fromTypedNode(r['made_by']), u'Igor') + state = validate_xhtml(content) + if state is not None: self.assertTrue(state) + def test_library_index_rdfa(self): from htsworkflow.util.rdfhelp import \ add_default_schemas, get_model, load_string_into_model @@ -212,6 +216,8 @@ class SampleWebTestCase(TestCase): self.assertEqual(count, len(Library.objects.filter(hidden=False))) + state = validate_xhtml(response.content) + if state is not None: self.assertTrue(state) # The django test runner flushes the database between test suites not cases, # so to be more compatible with running via nose we flush the database tables # of interest before creating our sample data.