@@ -29,4 +29,4 @@ class Command(BaseCommand):
image = image.resize((size, size), Image.ANTIALIAS)
image.save(avatar_file, "PNG")
- self.stdout.write('Blank avatar was updated.')
+ self.stdout.write('Blank avatar was updated')
@@ -0,0 +1,17 @@
+from django.test import TestCase
+from django.utils.six import StringIO
+
+from misago.users.management.commands import updateblankavatar
+class UpdateBlankAvatarTests(TestCase):
+ def test_regen_blank_avatar(self):
+ """command regens blank avatar """
+ command = updateblankavatar.Command()
+ out = StringIO()
+ command.execute(stdout=out)
+ command_output = out.getvalue().splitlines()[0].strip()
+ self.assertEqual(command_output, 'Blank avatar was updated')