Example #1
0
 def test_base(self):
     account = ExternalAccount(identifier='http://example.com',
                               type=ExternalAccount.TYPE_WEBSITE, privacy=PUBLIC)
     serializer = WebsiteSerializer(account)
     data = serializer.data
     eq_(data, {'website': 'http://example.com',
                'privacy': 'Public'})
 def test_base(self):
     account = ExternalAccount(
         identifier="http://example.com",
         type=ExternalAccount.TYPE_WEBSITE,
         privacy=PUBLIC,
     )
     serializer = WebsiteSerializer(account)
     data = serializer.data
     eq_(data, {"website": "http://example.com", "privacy": "Public"})
Example #3
0
    def test_base(self):
        account = ExternalAccount(identifier='foobar',
                                  type=ExternalAccount.TYPE_AMO, privacy=PUBLIC)
        serializer = ExternalAccountSerializer(account)
        data = serializer.data

        eq_(data, {'type': 'amo',
                   'identifier': 'foobar',
                   'name': 'Mozilla Add-ons',
                   'privacy': 'Public'})
    def test_base(self):
        account = ExternalAccount(identifier="foobar",
                                  type=ExternalAccount.TYPE_AMO,
                                  privacy=PUBLIC)
        serializer = ExternalAccountSerializer(account)
        data = serializer.data

        eq_(
            data,
            {
                "type": "amo",
                "identifier": "foobar",
                "name": "Mozilla Add-ons",
                "privacy": "Public",
            },
        )