From 74f27f4947b757896c09af3d18cddf0d80a81330 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Tue, 20 Nov 2012 14:37:49 -0800 Subject: [PATCH] Test presence of species & species name on library index page. --- htsworkflow/frontend/samples/test_samples.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htsworkflow/frontend/samples/test_samples.py b/htsworkflow/frontend/samples/test_samples.py index 4e0c2a3..d64499d 100644 --- a/htsworkflow/frontend/samples/test_samples.py +++ b/htsworkflow/frontend/samples/test_samples.py @@ -208,14 +208,15 @@ class SampleWebTestCase(TestCase): body = """prefix rdf: prefix libns: - select ?library ?library_id ?name ?species_name + select ?library ?library_id ?name ?species ?species_name where { ?library a libns:Library . OPTIONAL { ?library libns:library_id ?library_id . } - OPTIONAL { ?library libns:species_name ?species_name . } + OPTIONAL { ?library libns:species ?species . + ?species libns:species_name ?species_name . } OPTIONAL { ?library libns:name ?name . } }""" - bindings = set(['library', 'library_id', 'name', 'species_name']) + bindings = {'library', 'library_id', 'name', 'species', 'species_name'} query = RDF.SPARQLQuery(body) count = 0 for r in query.execute(model): @@ -229,7 +230,7 @@ class SampleWebTestCase(TestCase): 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. -- 2.30.2