-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathtest_country_authorizations.py
57 lines (49 loc) · 1.92 KB
/
test_country_authorizations.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# -*- coding: utf-8 -*-
import responses
from mangopay.resources import CountryAuthorization
from tests import settings
from tests.test_base import BaseTest
class CountryAuthorizationsTest(BaseTest):
@responses.activate
def test_get_specific_country_authorizations(self):
self.register_mock([
{
'method': responses.GET,
'url': settings.MANGOPAY_API_SANDBOX_URL + 'countries/FR/authorizations',
'body': {
"CountryCode": "FR",
"CountryName": "France",
"Authorization": {
"BlockUserCreation": False,
"BlockBankAccountCreation": False,
"BlockPayout": False
},
"LastUpdate": 1644574249
},
'status': 200
}])
authorizations = CountryAuthorization.get_country_authorizations("FR")
self.assertIsNotNone(authorizations)
@responses.activate
def test_get_all_countries_authorizations(self):
self.register_mock([
{
'method': responses.GET,
'url': settings.MANGOPAY_API_SANDBOX_URL + 'countries/authorizations',
'body': [
{
"CountryCode": "FR",
"CountryName": "France",
"Authorization": {
"BlockUserCreation": False,
"BlockBankAccountCreation": False,
"BlockPayout": False
},
"LastUpdate": 1644574249
}
],
'status': 200
}])
authorizations = CountryAuthorization.get_all_countries_authorizations()
self.assertIsNotNone(authorizations)
self.assertIsNotNone(authorizations.data[0])