Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx-platform
Commits
84628e10
Commit
84628e10
authored
Aug 19, 2013
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start building tests
parent
5a90a659
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
lms/djangoapps/shoppingcart/tests.py
+14
-6
No files found.
lms/djangoapps/shoppingcart/tests.py
View file @
84628e10
...
...
@@ -4,24 +4,32 @@ Tests for the Shopping Cart
from
factory
import
DjangoModelFactory
from
django.test
import
TestCase
from
shoppingcart
import
models
from
shoppingcart
.models
import
Order
,
VerifiedCertificate
from
student.tests.factories
import
UserFactory
class
OrderFactory
(
DjangoModelFactory
):
FACTORY_FOR
=
models
.
Order
FACTORY_FOR
=
Order
class
OrderItem
(
DjangoModelFactory
):
FACTORY_FOR
=
models
.
OrderItem
class
VerifiedCertificateFactory
(
DjangoModelFactory
):
FACTORY_FOR
=
VerifiedCertificate
class
OrderTest
(
TestCase
):
def
setUp
(
self
):
self
.
user
=
UserFactory
.
create
()
self
.
cart
=
OrderFactory
.
create
(
user
=
self
.
user
,
status
=
'cart'
)
self
.
course_id
=
"test/course"
def
test_add_item_to_cart
(
self
):
pass
def
test_total_cost
(
self
):
# add items to the order
for
_
in
xrange
(
5
):
pass
cost
=
30
iterations
=
5
for
_
in
xrange
(
iterations
):
VerifiedCertificate
.
add_to_order
(
self
.
cart
,
self
.
user
,
self
.
course_id
,
cost
)
self
.
assertEquals
(
self
.
cart
.
total_cost
,
cost
*
iterations
)
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