diff options
Diffstat (limited to 'archaeological_finds/tests.py')
-rw-r--r-- | archaeological_finds/tests.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py index b44bc9979..a0c05dbe2 100644 --- a/archaeological_finds/tests.py +++ b/archaeological_finds/tests.py @@ -29,7 +29,7 @@ from ishtar_common.models import ImporterType, IshtarUser, ImporterColumn,\ FormaterType, ImportTarget, IshtarSiteProfile, ProfileType from ishtar_common.models import Person, get_current_profile, UserProfile, \ - Town, Area + Town, Area, IshtarImage from archaeological_context_records.models import Period, Dating, ContextRecord from archaeological_finds import models, views from archaeological_warehouse.models import Warehouse, WarehouseType @@ -713,7 +713,12 @@ class PackagingTest(FindInit, TestCase): self.create_finds(data_base={"label": u"Find 1"}, force=True) self.create_finds(data_base={"label": u"Find 2"}, force=True) - self.finds[0].image.save('ishtar-bg.jpg', File(open(img))) + image = IshtarImage.objects.create(name="Image!") + image.image.save('ishtar-bg.jpg', File(open(img))) + models.FindImage.objects.create( + item=self.finds[0], + image=image + ) self.finds[0].save() self.basket = models.FindBasket.objects.create( @@ -746,8 +751,8 @@ class PackagingTest(FindInit, TestCase): # image names used to be altered on save: check for this bug self.assertEqual( - resulting_find.image.name, - models.Find.objects.get(pk=first_find.pk).image.name + resulting_find.images.all()[0].name, + models.Find.objects.get(pk=first_find.pk).images.all()[0].name ) # new version of the find is in the basket |