summaryrefslogtreecommitdiff
path: root/chimere/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2015-02-14 13:47:10 +0100
committerÉtienne Loks <etienne.loks@proxience.com>2015-02-14 13:47:10 +0100
commit5d9f3d528e8cd3cd30471906783fae6d969c9d0f (patch)
tree3c21866b62e3f3e2b3b109d4644f308f05d519aa /chimere/tests.py
parent87d832cae6f59e28b2ef2e15b7078ccc325fb0c4 (diff)
downloadChimère-5d9f3d528e8cd3cd30471906783fae6d969c9d0f.tar.bz2
Chimère-5d9f3d528e8cd3cd30471906783fae6d969c9d0f.zip
Refactoring XSLT imports - fix tests
Diffstat (limited to 'chimere/tests.py')
-rw-r--r--chimere/tests.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/chimere/tests.py b/chimere/tests.py
index ef54d0b..3a3144e 100644
--- a/chimere/tests.py
+++ b/chimere/tests.py
@@ -137,8 +137,9 @@ class ImporterTest:
nb, nb_updated, res = importer.manager.get()
if awaited_nb == None:
continue
- self.assertEqual(nb, awaited_nb, msg=u"%s: get test failed" %
- unicode(self.__class__))
+ self.assertEqual(nb, awaited_nb,
+ msg=u"%s: get test failed - got %d when %d was awaited" %
+ (unicode(self.__class__), nb, awaited_nb))
self.assertEqual(nb_updated, 0)
for cat in importer.categories.all():
if cat not in nb_by_cat:
@@ -311,6 +312,17 @@ class HtmlXsltImporterTest(TestCase, ImporterTest):
importer1.categories.add(subcategories[0])
self.marker_importers = [(importer1, 7),]
+class XmlXsltImporterTest(TestCase, ImporterTest):
+ def setUp(self):
+ subcategories = subcategory_setup()
+ xslt1 = File(open(test_dir_path + 'tests/magny-xml.xslt'))
+ importer1 = Importer.objects.create(importer_type='XXLT',
+ source='http://www.chymeres.net/test/magny.xml',
+ source_file=xslt1,
+ default_localisation='SRID=4326;POINT(-4.5 48.4)',)
+ importer1.categories.add(subcategories[0])
+ self.marker_importers = [(importer1, 10),]
+
class FeedsTest(TestCase):
def setUp(self):
self.areas = areas_setup()
@@ -442,7 +454,7 @@ class DynamicCategoryTest(TestCase):
response = self.client.get(url)
self.assertEqual(200, response.status_code)
cats = json.loads(response.content)['categories']
- self.assertEqual(len(cats), 2)
+ self.assertEqual(len(cats), 5)
class NewsTest(TestCase):
def setUp(self):