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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
xmrauctions/items/tests/test_forms.py

28 lines
802 B
Python

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())