'Ensure that regardless of the input format or dimensions, the outcome
of calling the function is square jpeg files with explicitly-requested
dimensions being saved to the profile image storage backend.'

@ddt.data(*product(['gif', 'jpg', 'png'], [(1, 1), (10, 10), (100, 100), (1000, 1000), (1, 10), (10, 100), (100, 1000), (1000, 999)]))
@ddt.unpack
def test_generation(self, image_type, dimensions):

    extension = ('.' + image_type)
    content_type = ('image/' + image_type)
    requested_sizes = {10: 'ten.jpg', 100: 'hundred.jpg', 1000: 'thousand.jpg'}
    with make_uploaded_file(dimensions=dimensions, extension=extension, content_type=content_type) as uploaded_file:
        names_and_images = self._create_mocked_profile_images(uploaded_file, requested_sizes)
        actual_sizes = {}
        for (name, image_obj) in names_and_images:
            (width, height) = image_obj.size
            self.assertEqual(width, height)
            actual_sizes[width] = name
        self.assertEqual(requested_sizes, actual_sizes)
