@@ -526,7 +526,7 @@ def test_get_manual_ident_url(self):
526526 article_url = u'http://example.com/news?id=10&emoji=😄'
527527 article_ids = ['aid≠1' , b'aid\xe2 \x89 \xa0 2' ]
528528
529- url = self .lp .get_manual_ident_url (article_url , article_ids )
529+ url = self .lp .get_manual_ident_url (article_url , article_ids , muid = 'blụb' )
530530
531531 url_info = urlparse (url )
532532
@@ -555,6 +555,7 @@ def test_get_manual_ident_url(self):
555555 self .assertEqual (data , {
556556 'back' : u'http://example.com/news?id=10&emoji=\U0001f604 ' ,
557557 'ids' : [u'aid\u2260 1' , u'aid\u2260 2' ],
558+ 'muid' : u'bl\u1ee5 b'
558559 })
559560
560561 def test_get_manual_ident_token (self ):
@@ -569,6 +570,20 @@ def test_get_manual_ident_token(self):
569570 'ids' : [u'aid\u2260 1' , u'aid\u2260 2' ],
570571 })
571572
573+ def test_get_manual_ident_token_muid (self ):
574+ article_url = 'http://example.com/news'
575+ article_ids = ['aid=1' ]
576+ muid = u'😄'
577+
578+ token = self .lp ._get_manual_ident_token (article_url , article_ids , muid = muid )
579+ data = jwt .decode (token , self .lp .shared_secret )
580+
581+ self .assertEqual (data , {
582+ 'back' : 'http://example.com/news' ,
583+ 'ids' : ['aid=1' ],
584+ 'muid' : u'\U0001f604 ' ,
585+ })
586+
572587
573588if __name__ == '__main__' :
574589 unittest .main ()
0 commit comments