Пример #1
0
 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)
Пример #2
0
 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)