Removed unit test for unknown emails
This behaviour is going to change, and by splitting that change up into two commits the diff makes much more sense.
This commit is contained in:
@@ -160,27 +160,6 @@ class UserModifiedTest(AbstractCloudTest):
|
|||||||
self.assertEqual('คนรักของผัดไทย', db_user['full_name'])
|
self.assertEqual('คนรักของผัดไทย', db_user['full_name'])
|
||||||
self.assertEqual({'subscriber'}, set(db_user['roles']))
|
self.assertEqual({'subscriber'}, set(db_user['roles']))
|
||||||
|
|
||||||
def test_unknown_email(self):
|
|
||||||
payload = {'id': 1112333,
|
|
||||||
'old_email': 'unknown@email.address',
|
|
||||||
'full_name': 'ကြယ်ဆွတ်',
|
|
||||||
'email': 'new@email.address',
|
|
||||||
'roles': ['cloud_demo']}
|
|
||||||
as_json = json.dumps(payload).encode()
|
|
||||||
mac = hmac.new(self.hmac_secret,
|
|
||||||
as_json, hashlib.sha256)
|
|
||||||
self.post('/api/webhooks/user-modified',
|
|
||||||
data=as_json,
|
|
||||||
content_type='application/json',
|
|
||||||
headers={'X-Webhook-HMAC': mac.hexdigest()},
|
|
||||||
expected_status=204)
|
|
||||||
|
|
||||||
# Check the effect on the user
|
|
||||||
db_user = self.fetch_user_from_db(self.uid)
|
|
||||||
self.assertEqual('old@email.address', db_user['email'])
|
|
||||||
self.assertEqual('คนรักของผัดไทย', db_user['full_name'])
|
|
||||||
self.assertEqual({'subscriber'}, set(db_user['roles']))
|
|
||||||
|
|
||||||
def test_huge_request(self):
|
def test_huge_request(self):
|
||||||
payload = b'a' * 1024 * 100
|
payload = b'a' * 1024 * 100
|
||||||
mac = hmac.new(self.hmac_secret, payload, hashlib.sha256)
|
mac = hmac.new(self.hmac_secret, payload, hashlib.sha256)
|
||||||
|
Reference in New Issue
Block a user