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
73549172
Commit
73549172
authored
Nov 26, 2017
by
Michael Frey
Committed by
Michael Frey
Nov 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No need to check for empty string on email domains. They can be blank or NULL in the model.
parent
6f23ee6b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
6 deletions
+2
-6
ecommerce/extensions/offer/models.py
+0
-4
ecommerce/extensions/offer/tests/test_models.py
+2
-2
No files found.
ecommerce/extensions/offer/models.py
View file @
73549172
...
...
@@ -55,10 +55,6 @@ class ConditionalOffer(AbstractConditionalOffer):
super
(
ConditionalOffer
,
self
)
.
clean
()
# pylint: disable=bad-super-call
def
clean_email_domains
(
self
):
if
self
.
email_domains
==
''
:
log_message_and_raise_validation_error
(
'Failed to create ConditionalOffer. ConditionalOffer email domains may not be an empty string.'
)
if
self
.
email_domains
:
if
not
isinstance
(
self
.
email_domains
,
basestring
):
...
...
ecommerce/extensions/offer/tests/test_models.py
View file @
73549172
...
...
@@ -419,7 +419,7 @@ class ConditionalOfferTests(TestCase):
self
.
assertTrue
(
self
.
offer
.
is_email_valid
(
valid_email_2
))
@ddt.data
(
'domain.com'
,
'multi.it,domain.hr'
,
'sub.domain.net'
,
'例如.com'
,
'val-id.例如'
,
'valid1.co例如'
,
'
'
,
'
domain.com'
,
'multi.it,domain.hr'
,
'sub.domain.net'
,
'例如.com'
,
'val-id.例如'
,
'valid1.co例如'
,
'valid-domain.com'
,
'çççç.рф'
,
'çç-ççç32.中国'
,
'ççç.ççç.இலங்கை'
)
def
test_creating_offer_with_valid_email_domains
(
self
,
email_domains
):
...
...
@@ -428,7 +428,7 @@ class ConditionalOfferTests(TestCase):
self
.
assertEqual
(
offer
.
email_domains
,
email_domains
)
@ddt.data
(
'
'
,
'
noDot'
,
'spaceAfter.comma, domain.hr'
,
'nothingAfterDot.'
,
'.nothingBeforeDot'
,
'space not.allowed'
,
'noDot'
,
'spaceAfter.comma, domain.hr'
,
'nothingAfterDot.'
,
'.nothingBeforeDot'
,
'space not.allowed'
,
3
,
'-invalid.com'
,
'invalid'
,
'invalid-.com'
,
'invalid.c'
,
'valid.com,'
,
'invalid.photography1'
,
'valid.com,invalid'
,
'valid.com,invalid-.com'
,
'valid.com,-invalid.com'
,
'in--valid.com'
,
'in..valid.com'
,
'valid.com,invalid.c'
,
'invalid,valid.com'
,
'çççç.çç-çç'
,
'ççç.xn--ççççç'
,
'çççç.çç--çç.ççç'
...
...
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