'A DELETE request to /json/realm/icon should delete the realm icon and return gravatar URL'

def test_delete_icon(self):

    self.login(self.example_email('iago'))
    realm = get_realm('zulip')
    realm.icon_source = Realm.ICON_UPLOADED
    realm.save()
    result = self.client_delete('/json/realm/icon')
    self.assert_json_success(result)
    json = ujson.loads(result.content)
    self.assertIn('icon_url', json)
    realm = get_realm('zulip')
    self.assertEqual(json['icon_url'], realm_icon_url(realm))
    self.assertEqual(realm.icon_source, Realm.ICON_FROM_GRAVATAR)
