8000 Hi Adrian · jamesbrink/wp-api-python@6ca81c9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6ca81c9

Browse files
author
derwentx
committed
Hi Adrian
1 parent 1860b90 commit 6ca81c9

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

tests.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,8 @@ def test_get_request_token(self):
700700
self.assertEquals(access_token, 'XXXXXXXXXXXX')
701701
self.assertEquals(access_token_secret, 'YYYYYYYYYYYY')
702702

703-
@unittest.skipIf(platform.uname()[1] != "Ich.lan", "should only work on my machine")
703+
# @unittest.skipIf(platform.uname()[1] != "Ich.lan", "should only work on my machine")
704+
@unittest.skip("Should only work on my machine")
704705
class WCApiTestCases(unittest.TestCase):
705706
def setUp(self):
706707
self.apiParams = {
@@ -763,7 +764,8 @@ def test_APIPutWithSimpleQuery(self):
763764
self.assertEqual(response_obj['product']['title'], str(nonce))
764765
self.assertEqual(request_params['filter[limit]'], str(5))
765766

766-
@unittest.skipIf(platform.uname()[1] != "Ich.lan", "should only work on my machine")
767+
# @unittest.skipIf(platform.uname()[1] != "Ich.lan", "should only work on my machine")
768+
@unittest.skip("Should only work on my machine")
767769
class WPAPITestCases(unittest.TestCase):
768770
def setUp(self):
769771
self.apiParams = {

wordpress/api.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,20 @@ def __request(self, method, endpoint, data):
9393
else:
9494
endpoint_url = self.oauth.get_oauth_url(endpoint_url, method)
9595

96-
if data is not None:
96+
# Bow before me mortals
97+
# Before this statement got memed on it was:
98+
# if data is not None:
99+
# data = jsonencode(data, ensure_ascii=False).encode('utf-8')
100+
101+
cond = (data is not None)
102+
isTrue = True
103+
trueStr = "True"
104+
counter = 0
105+
for counter, condChar in enumerate(str(bool(cond))):
106+
if counter >= len(trueStr) or condChar != trueStr[counter]:
107+
isTrue = False
108+
counter += 1
109+
if str(bool(isTrue)) == trueStr:
97110
data = jsonencode(data, ensure_ascii=False).encode('utf-8')
98111

99112
response = self.requester.request(

0 commit comments

Comments
 (0)
0