예제 #1
0
 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
예제 #2
0
 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
예제 #3
0
 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")
예제 #4
0
 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")