# -*- coding: utf-8 -*- from allauth.socialaccount.tests import OAuthTestsMixin from allauth.tests import MockedResponse, TestCase from .provider import OpenStreetMapProvider class OpenStreetMapTests(OAuthTestsMixin, TestCase): provider_id = OpenStreetMapProvider.id def get_mocked_response(self): return [ MockedResponse( 200, r""" """, ) ] # noqa def test_login(self): account = super(OpenStreetMapTests, self).test_login() osm_account = account.get_provider_account() self.assertEqual(osm_account.get_username(), "Steve") self.assertEqual( osm_account.get_avatar_url(), "https://secure.gravatar.com/avatar.jpg", ) self.assertEqual( osm_account.get_profile_url(), "https://www.openstreetmap.org/user/Steve", )