You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
802 B
Python
28 lines
802 B
Python
5 years ago
|
from django.test import TestCase
|
||
|
from items.forms import CreateItemForm, SearchItemForm
|
||
|
from core.monero import AuctionWallet
|
||
|
|
||
|
|
||
|
class ItemFormsTestCase(TestCase):
|
||
|
def setUp(self):
|
||
|
self.aw = AuctionWallet()
|
||
|
|
||
|
def test_create_item_form_is_valid(self):
|
||
|
data = {
|
||
|
'name': 'Expected item name',
|
||
|
'description': 'expected description',
|
||
|
'whereabouts': 'anywhere in the world',
|
||
|
'ask_price_xmr': .1,
|
||
|
'payout_address': self.aw.wallet.accounts[0].address(),
|
||
|
}
|
||
|
form = CreateItemForm(data=data)
|
||
|
self.assertTrue(form.is_valid())
|
||
|
|
||
|
def test_search_item_form_is_valid(self):
|
||
|
data = {
|
||
|
'search': ''
|
||
|
}
|
||
|
form = SearchItemForm(data=data)
|
||
|
self.assertTrue(form.is_valid())
|
||
|
|