本文整理汇总了Python中models.Photo.shot_date方法的典型用法代码示例。如果您正苦于以下问题:Python Photo.shot_date方法的具体用法?Python Photo.shot_date怎么用?Python Photo.shot_date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Photo
的用法示例。
在下文中一共展示了Photo.shot_date方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_image_palette
# 需要导入模块: from models import Photo [as 别名]
# 或者: from models.Photo import shot_date [as 别名]
def test_image_palette(self):
"""
Test images uploading to the correct location.
"""
IMAGE_FILE = "test_images/22.jpg"
p = Photo()
p.image = IMAGE_FILE
p.shot_date="2010-10-10"
p.save()
# are the palette colors correct?
# this test will break when/if the palette generation
# algorithm is changed, obviously.
self.failUnlessEqual( p.suggest0, "262624" )
self.failUnlessEqual( p.suggest1, "797a7a" )
self.failUnlessEqual( p.suggest2, "373835" )
self.failUnlessEqual( p.suggest3, "111210" )
self.failUnlessEqual( p.suggest4, "525251" )
self.failUnlessEqual( p.suggest5, "090908" )
self.failUnlessEqual( p.suggest6, "1a1b19" )
self.failUnlessEqual( p.suggest7, "bbb8b3" )