1 # -*- coding: utf-8 -*-
2 from __future__ import with_statement
5 from django.test import TestCase
6 from picture.models import Picture
9 class PictureTest(TestCase):
11 def test_import(self):
12 picture = Picture.from_xml_file(path.join(path.dirname(__file__), "files/kandinsky-composition-viii.xml"))
14 motifs = set([tag.name for tag in picture.tags if tag.category == 'theme'])
15 assert motifs == set([u'nieporządek']), 'theme tags are wrong. %s' % motifs
19 def test_import_with_explicit_image(self):
20 picture = Picture.from_xml_file(path.join(path.dirname(__file__), "files/kandinsky-composition-viii.xml"),
21 path.join(path.dirname(__file__), "files/kandinsky-composition-viii.png"))