Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ecommerce
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
ecommerce
Commits
c6000520
Commit
c6000520
authored
Mar 02, 2017
by
Michael Frey
Committed by
Michael Frey
Mar 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test
parent
5e38805e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
ecommerce/extensions/payment/tests/test_utils.py
+12
-2
No files found.
ecommerce/extensions/payment/tests/test_utils.py
View file @
c6000520
# -*- coding: utf-8 -*-
import
json
import
json
import
time
import
time
from
urllib
import
urlencode
from
urllib
import
urlencode
...
@@ -65,8 +66,8 @@ class SDNCheckTests(TestCase):
...
@@ -65,8 +66,8 @@ class SDNCheckTests(TestCase):
'sources'
:
self
.
site_configuration
.
sdn_api_list
,
'sources'
:
self
.
site_configuration
.
sdn_api_list
,
'api_key'
:
self
.
site_configuration
.
sdn_api_key
,
'api_key'
:
self
.
site_configuration
.
sdn_api_key
,
'type'
:
'individual'
,
'type'
:
'individual'
,
'name'
:
self
.
name
,
'name'
:
unicode
(
self
.
name
)
.
encode
(
'utf-8'
)
,
'address'
:
self
.
address
,
'address'
:
unicode
(
self
.
address
)
.
encode
(
'utf-8'
)
,
'countries'
:
self
.
country
'countries'
:
self
.
country
})
})
sdn_check_url
=
'{api_url}?{params}'
.
format
(
sdn_check_url
=
'{api_url}?{params}'
.
format
(
...
@@ -113,6 +114,15 @@ class SDNCheckTests(TestCase):
...
@@ -113,6 +114,15 @@ class SDNCheckTests(TestCase):
response
=
self
.
sdn_validator
.
search
(
self
.
name
,
self
.
address
,
self
.
country
)
response
=
self
.
sdn_validator
.
search
(
self
.
name
,
self
.
address
,
self
.
country
)
self
.
assertEqual
(
response
,
sdn_response
)
self
.
assertEqual
(
response
,
sdn_response
)
@httpretty.activate
def
test_sdn_check_unicode_match
(
self
):
""" Verify the SDN check returns the number of matches and records the match. """
sdn_response
=
{
'total'
:
1
}
self
.
name
=
u'Keyser Söze'
self
.
mock_sdn_response
(
json
.
dumps
(
sdn_response
))
response
=
self
.
sdn_validator
.
search
(
self
.
name
,
self
.
address
,
self
.
country
)
self
.
assertEqual
(
response
,
sdn_response
)
def
test_deactivate_user
(
self
):
def
test_deactivate_user
(
self
):
""" Verify an SDN failure is logged. """
""" Verify an SDN failure is logged. """
response
=
{
'description'
:
'Bad dude.'
}
response
=
{
'description'
:
'Bad dude.'
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment