-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When retry fullfillment, the BasketTransactionIntegration was rasing mysql error. fix #4
- Loading branch information
Showing
4 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from nau_extensions.models import BasketTransactionIntegration | ||
from oscar.test import factories | ||
|
||
from ecommerce.extensions.test.factories import create_basket, create_order | ||
from ecommerce.tests.factories import UserFactory | ||
from ecommerce.tests.testcases import TestCase | ||
|
||
|
||
class ModelsNAUExtensionsTests(TestCase): | ||
""" | ||
This class aims to test the specifics of the nau extensions project related to django models. | ||
""" | ||
|
||
def setUp(self): | ||
super(ModelsNAUExtensionsTests, self).setUp() | ||
self.order = create_order(user=UserFactory()) | ||
self.order.save() | ||
self.order.basket.save() | ||
|
||
def test_basket_integration_integration_create_second(self): | ||
""" | ||
Test the creation of a second `BasketTransactionIntegration` for same basket/order. | ||
""" | ||
BasketTransactionIntegration.create(self.order.basket) | ||
|
||
# the 2nd call on create should fail | ||
BasketTransactionIntegration.create(self.order.basket) |