31 lines
700 B
Python
31 lines
700 B
Python
import shutil
|
|
|
|
from quixote import cleanup
|
|
from wcs.qommon.http_request import HTTPRequest
|
|
from auquotidien.modules import payments
|
|
|
|
from utilities import get_app, login, create_temporary_pub
|
|
|
|
def setup_module(module):
|
|
cleanup()
|
|
|
|
global pub
|
|
|
|
pub = create_temporary_pub()
|
|
|
|
req = HTTPRequest(None, {'SCRIPT_NAME': '/', 'SERVER_NAME': 'example.net'})
|
|
pub.set_app_dir(req)
|
|
pub.cfg['identification'] = {'methods': ['password']}
|
|
pub.write_cfg()
|
|
|
|
|
|
def teardown_module(module):
|
|
shutil.rmtree(pub.APP_DIR)
|
|
|
|
|
|
def test_invoice_crc():
|
|
invoice = payments.Invoice()
|
|
for i in range(20):
|
|
new_id = invoice.get_new_id()
|
|
assert payments.Invoice.check_crc(new_id)
|