def test_build_geo_thumbnail(self): """ test that build_geometry builds the correct geometry with 2d and width/height only """ old_x_for_dim = getattr(settings, "LAZYTHUMBS_USE_X_FOR_DIMENSIONS", None) settings.LAZYTHUMBS_USE_X_FOR_DIMENSIONS = False self.assertEqual(build_geometry("thumbnail", 10, 20), "10") self.assertEqual(build_geometry("thumbnail", 10, None), "10") self.assertEqual(build_geometry("thumbnail", None, 20), "x/20") settings.LAZYTHUMBS_USE_X_FOR_DIMENSIONS = old_x_for_dim
def test_build_geo_thumbnail(self): """ test that build_geometry builds the correct geometry with 2d and width/height only """ old_x_for_dim = getattr(settings, 'LAZYTHUMBS_USE_X_FOR_DIMENSIONS', None) settings.LAZYTHUMBS_USE_X_FOR_DIMENSIONS = False self.assertEqual(build_geometry('thumbnail', 10, 20), "10") self.assertEqual(build_geometry('thumbnail', 10, None), "10") self.assertEqual(build_geometry('thumbnail', None, 20), "x/20") settings.LAZYTHUMBS_USE_X_FOR_DIMENSIONS = old_x_for_dim
def test_build_geo_with_x_dim_thumbnail(self, settings): settings.LAZYTHUMBS_USE_X_FOR_DIMENSIONS = True """ test that build_geometry builds the correct geometry with 2d and width/height only """ self.assertEqual(build_geometry('thumbnail', 10, 20), "10") self.assertEqual(build_geometry('thumbnail', 10, None), "10") self.assertEqual(build_geometry('thumbnail', None, 20), "x20")
def test_build_geo_with_x_dim_thumbnail(self, settings): settings.LAZYTHUMBS_USE_X_FOR_DIMENSIONS = True """ test that build_geometry builds the correct geometry with 2d and width/height only """ self.assertEqual(build_geometry("thumbnail", 10, 20), "10") self.assertEqual(build_geometry("thumbnail", 10, None), "10") self.assertEqual(build_geometry("thumbnail", None, 20), "x20")