This repository has been archived by the owner on Mar 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andy McKay
committed
Mar 7, 2013
1 parent
3ed2398
commit 2d1a3e4
Showing
7 changed files
with
100 additions
and
540 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,40 @@ | ||
from decimal import Decimal | ||
|
||
import amo | ||
from addons.models import Addon | ||
from market.models import AddonPremium, Price, PriceCurrency | ||
from users.models import UserProfile | ||
|
||
from mkt.developers.models import (AddonPaymentAccount, PaymentAccount, | ||
SolitudeSeller) | ||
from mkt.site.fixtures import fixture | ||
|
||
|
||
class PurchaseTest(amo.tests.TestCase): | ||
fixtures = fixture('prices', 'user_admin', 'user_999', 'webapp_337141') | ||
|
||
def setUp(self): | ||
self.create_switch(name='marketplace') | ||
self.addon = Addon.objects.get(pk=337141) | ||
self.addon.update(premium_type=amo.ADDON_PREMIUM) | ||
self.user = UserProfile.objects.get(email='regular@mozilla.com') | ||
self.price = Price.objects.get(pk=1) | ||
AddonPremium.objects.create(addon=self.addon, price=self.price, | ||
currencies=['BRL']) | ||
assert self.client.login(username='regular@mozilla.com', | ||
password='password') | ||
self.brl = PriceCurrency.objects.create(currency='BRL', | ||
price=Decimal('0.5'), | ||
tier_id=1) | ||
|
||
def setup_package(self): | ||
self.seller = SolitudeSeller.objects.create( | ||
resource_uri='/path/to/sel', uuid='seller-id', | ||
user=self.user) | ||
self.account = PaymentAccount.objects.create( | ||
user=self.user, uri='asdf', name='test', inactive=False, | ||
solitude_seller=self.seller, bango_package_id=123) | ||
AddonPaymentAccount.objects.create( | ||
addon=self.addon, provider='bango', account_uri='foo', | ||
payment_account=self.account, product_uri='bpruri', | ||
set_price=12345) |
Oops, something went wrong.