示例#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'})
示例#2
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"})
示例#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'})
示例#4
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",
            },
        )