def test_if_no_title_uses_image_name(self): """ If there's no title then the image's name should be the default. """ with open( os.path.join(settings.BASE_DIR, 'images', 'tests', 'data', 'image.png'), "rb") as image_file: image = Image( image=SimpleUploadedFile("test.png", image_file.read())) image.set_title() self.assertEquals('test.png', image.title)
def test_if_no_title_uses_image_name(self): """ If there's no title then the image's name should be the default. """ with open( os.path.join(settings.BASE_DIR, 'images', 'tests', 'data', 'image.png'), "rb" ) as image_file: image = Image( image=SimpleUploadedFile("test.png", image_file.read()) ) image.set_title() self.assertEquals('test.png', image.title)