diff --git a/posts.py b/posts.py index 8cbcede47..a0920284c 100644 --- a/posts.py +++ b/posts.py @@ -1831,11 +1831,16 @@ def threadSendPost(session, postJsonStr: str, federationList: [], for attempt in range(20): postResult = None unauthorized = False + if debug: + print('Getting postJsonString for ' + inboxUrl) try: postResult, unauthorized = \ postJsonString(session, postJsonStr, federationList, inboxUrl, signatureHeaderJson, debug) + if debug: + print('Obtained postJsonString for ' + inboxUrl + + ' unauthorized: ' + str(unauthorized)) except Exception as e: print('ERROR: postJsonString failed ' + str(e)) if unauthorized: diff --git a/tests.py b/tests.py index 3ff5eb714..83ecabca7 100644 --- a/tests.py +++ b/tests.py @@ -95,6 +95,7 @@ from newswire import getNewswireTags from newswire import parseFeedDate from mastoapiv1 import getMastoApiV1IdFromNickname from mastoapiv1 import getNicknameFromMastoApiV1Id +from webapp_post import prepareHtmlPostNickname testServerAliceRunning = False testServerBobRunning = False @@ -3072,9 +3073,25 @@ def testDomainHandling(): assert decodedHost(testDomain) == "espaƱa.icom.museum" +def testPrepareHtmlPostNickname(): + print('testPrepareHtmlPostNickname') + postHtml = '