You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

31 lines
1.2 KiB

from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Команда для тестов'
def handle(self, *args, **options):
from xml.dom import minidom
xx = """<?xml version="1.0" encoding="UTF-8"?>
<repeatCardPaymentResponse status="3" error="112" processedDT="2018-04-23T19:37:04.544+03:00" techMessage="Неверное значение параметра invoiceId" clientOrderId="unknown"/>"""
dom = minidom.parseString(xx)
dom.normalize()
node1 = dom.getElementsByTagName("repeatCardPaymentResponse")[0]
print(node1)
print(node1.getAttribute('error'))
print(node1.getAttribute('processedDT'))
print(node1.getAttribute('techMessage'))
# def handle(self, *args, **options):
# from finance.loggers import FinanceLogger
# logger = FinanceLogger()
# try:
# 10 / 0
# except Exception as exc:
# logger.exception('FinanceLogger test log record', extra={'asdf': 3246523},
# invoice_id=42, some_param={'a': 1, 'b': 3, 'привет': 'медвед'}
# )
#