def test_with_user_no_images_from_banned_users(self):
        # Create a new thread and message
        thread = mommy.make('connectmessages.Thread', group=self.group)
        message = mommy.make(
            'connectmessages.Message', thread=thread, sender=self.banned_user)

        # Create and attach a new image
        image1 = Image()
        image1.user = message.sender
        image1.image = File(open(self.smallfile))
        image1.save()
        message.images.add(image1)

        result = self.client.get(reverse('admin_gallery'))
        self.assertEqual(result.status_code, 200)
        self.assertNotIn(image1, result.context['images'])
Images from banned users shouldn't be present.
dataset/ETHPy150Open ofa/connect/open_connect/media/tests/test_models.py/ImagePopularityManagerTest.test_with_user_no_images_from_banned_users