1 # -*- coding: utf-8 -*-
2 from __future__ import with_statement
4 from django.core.files.base import ContentFile, File
5 from catalogue.test_utils import *
6 from catalogue import models
7 from librarian import WLURI
8 from picture.models import Picture
10 from nose.tools import raises
12 from os import unlink, path, makedirs
15 class PictureTest(TestCase):
17 def test_import(self):
18 picture = Picture.from_xml_file(path.join(path.dirname(__file__), "files/kandinsky-composition-viii.xml"))
20 motifs = set([tag.name for tag in picture.tags if tag.category == 'theme'])
21 assert motifs == set([u'nieporządek']), 'theme tags are wrong. %s' % motifs
25 def test_import_with_explicit_image(self):
26 picture = Picture.from_xml_file(path.join(path.dirname(__file__), "files/kandinsky-composition-viii.xml"),
27 path.join(path.dirname(__file__), "files/kandinsky-composition-viii.png"))