Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
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
course-discovery
Commits
0426ed5c
Commit
0426ed5c
authored
May 23, 2016
by
Peter Fogg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update acceptance tests to verify affiliate cookie domain.
ECOM-4329
parent
2d308c9b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
acceptance_tests/affiliate_cookie_tests.py
+5
-2
acceptance_tests/config.py
+3
-0
No files found.
acceptance_tests/affiliate_cookie_tests.py
View file @
0426ed5c
...
...
@@ -6,7 +6,8 @@ from unittest import TestCase
from
selenium
import
webdriver
from
acceptance_tests.config
import
(
BASIC_AUTH_USERNAME
,
BASIC_AUTH_PASSWORD
,
ECOMMERCE_URL_ROOT
,
MARKETING_SITE_URL_ROOT
,
LMS_URL_ROOT
AFFILIATE_COOKIE_NAME
,
BASIC_AUTH_USERNAME
,
BASIC_AUTH_PASSWORD
,
COOKIE_DOMAIN
,
ECOMMERCE_URL_ROOT
,
LMS_URL_ROOT
,
MARKETING_SITE_URL_ROOT
)
...
...
@@ -30,12 +31,13 @@ class AffiliateCookieTestMixin(object):
which will be used to test cookie tracking.
"""
cookie_name
=
"affiliate_id"
cookie_value
=
"test_partner"
def
setUp
(
self
):
super
()
.
setUp
()
self
.
browser
=
webdriver
.
Firefox
()
self
.
cookie_name
=
AFFILIATE_COOKIE_NAME
self
.
cookie_domain
=
COOKIE_DOMAIN
def
tearDown
(
self
):
super
()
.
tearDown
()
...
...
@@ -56,6 +58,7 @@ class AffiliateCookieTestMixin(object):
cookie
=
self
.
browser
.
get_cookie
(
self
.
cookie_name
)
self
.
assertIsNotNone
(
cookie
)
self
.
assertEqual
(
cookie
[
'value'
],
self
.
cookie_value
)
self
.
assertEqual
(
cookie
[
'domain'
],
self
.
cookie_domain
)
def
test_with_query_wrong_medium
(
self
):
"""Verify that requests without utm_medium=affiliate_partner do not get a cookie."""
...
...
acceptance_tests/config.py
View file @
0426ed5c
...
...
@@ -18,3 +18,6 @@ ECOMMERCE_URL_ROOT = os.environ.get('ECOMMERCE_URL_ROOT', 'https://ecommerce.sta
BASIC_AUTH_USERNAME
=
os
.
environ
.
get
(
'BASIC_AUTH_USERNAME'
,
''
)
BASIC_AUTH_PASSWORD
=
os
.
environ
.
get
(
'BASIC_AUTH_PASSWORD'
,
''
)
AFFILIATE_COOKIE_NAME
=
os
.
environ
.
get
(
'AFFILIATE_COOKIE_NAME'
,
'affiliate_id'
)
COOKIE_DOMAIN
=
os
.
environ
.
get
(
'COOKIE_DOMAIN'
,
'.edx.org'
)
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