[test] Test de création/suppression de factures
This commit is contained in:
parent
bd823060ce
commit
3cf36346ab
1 changed files with 24 additions and 26 deletions
50
test.py
50
test.py
|
@ -62,7 +62,9 @@ club_ldif = {
|
|||
'chbre' : [ u'EXT' ],
|
||||
}
|
||||
|
||||
facture_ldif = {}
|
||||
facture_ldif = {
|
||||
'modePaiement' : [u'test'],
|
||||
}
|
||||
|
||||
|
||||
def keys_of_list_of_dict(l, type=''):
|
||||
|
@ -205,8 +207,6 @@ else:
|
|||
tests_machines(adherent.dn, ["wifi-adh", "wifi-adh-v6"], ipsec=True)
|
||||
|
||||
|
||||
|
||||
|
||||
#############################################
|
||||
# Création et suppression de machines Crans #
|
||||
#############################################
|
||||
|
@ -242,7 +242,28 @@ else:
|
|||
else: print OK
|
||||
|
||||
|
||||
#######################################
|
||||
# Création et suppression de factures #
|
||||
#######################################
|
||||
|
||||
anim("Creation d'une facture")
|
||||
try:
|
||||
facture = conn.newFacture(adherent.dn, facture_ldif)
|
||||
facture.create()
|
||||
except Exception as error:
|
||||
print ERREUR
|
||||
if show_traceback: print traceback.format_exc()
|
||||
else: print "\t%r" % error
|
||||
else:
|
||||
print OK
|
||||
anim("Suppression d'une facture")
|
||||
try:
|
||||
facture = conn.search(u'fid=%s' % facture['fid'][0], mode='rw')[0]
|
||||
facture.delete()
|
||||
except Exception:
|
||||
print ERREUR
|
||||
print traceback.format_exc()
|
||||
else: print OK
|
||||
|
||||
|
||||
############################
|
||||
|
@ -258,26 +279,3 @@ if adherent:
|
|||
print ERREUR
|
||||
print traceback.format_exc()
|
||||
else: print OK
|
||||
|
||||
|
||||
#######################################
|
||||
# Création et suppression de factures #
|
||||
#######################################
|
||||
|
||||
anim("Creation d'une facture")
|
||||
try:
|
||||
facture = conn.newFacture(facture_ldif)
|
||||
except Exception as error:
|
||||
print ERREUR
|
||||
if show_traceback: print traceback.format_exc()
|
||||
else: print "\t%r" % error
|
||||
else:
|
||||
print OK
|
||||
try:
|
||||
facture = conn.search(u'fid=%s' % facture['fid'][0], mode='rw')[0]
|
||||
facture.delete()
|
||||
except Exception:
|
||||
print ERREUR
|
||||
print traceback.format_exc()
|
||||
else: print OK
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue