-class PictureTests(ApiTest):
- def test_publish(self):
- slug = "kandinsky-composition-viii"
- with open(path.join(
- picture.tests.__path__[0], "files", slug + ".xml"
- ), 'rb') as f:
- xml = SimpleUploadedFile(
- 'composition8.xml',
- f.read())
- with open(path.join(
- picture.tests.__path__[0], "files", slug + ".png"
- ), 'rb') as f:
- img = SimpleUploadedFile(
- 'kompozycja-8.png',
- f.read())
-
- import_form = PictureImportForm({}, {
- 'picture_xml_file': xml,
- 'picture_image_file': img
- })
-
- assert import_form.is_valid()
- if import_form.is_valid():
- import_form.save()
-
- Picture.objects.get(slug=slug)
-
-