def test_is_not_valid(): photo = Photo(helper.get_file('text.txt')) assert not photo.is_valid()
def test_is_valid(): photo = Photo(helper.get_file('plain.jpg')) assert photo.is_valid()
def test_pillow_not_loaded(): photo = Photo(helper.get_file('imghdr-error.jpg')) photo.pillow = None assert photo.is_valid() == False
def test_is_valid(): photo = Photo(helper.get_file('with-location.jpg')) assert photo.is_valid()
def test_is_valid_fallback_using_pillow(): photo = Photo(helper.get_file('imghdr-error.jpg')) assert photo.is_valid()