Commit e71686c9 authored by Valentin Samir's avatar Valentin Samir

[test.py] Quelques tests en plus

parent 83b2e65a
......@@ -67,7 +67,7 @@ club_ldif = {
}
facture_ldif = {
'modePaiement' : [u'test'],
'modePaiement' : [u'liquide'],
}
......@@ -195,6 +195,17 @@ if not mail_format:
print "Test des attributs des adhérents"
test_list_of_dict(adherents_attrs_keys, adherents)
factures = conn.search(u"fid=*", sizelimit=-1, mode='ro' if fast_test else 'rw')
factures_attrs_keys = keys_of_list_of_dict(factures, 'factures')
if not mail_format:
print "Test des attributs des factures"
test_list_of_dict(factures_attrs_keys, factures)
certificats = conn.search(u"xid=*", sizelimit=-1, mode='ro' if fast_test else 'rw')
certificats_attrs_keys = keys_of_list_of_dict(certificats, 'certificats')
if not mail_format:
print "Test des attributs des certificats"
test_list_of_dict(certificats_attrs_keys, certificats)
if not mail_format:
print "Test de création d'objets"
......@@ -259,24 +270,25 @@ else:
# Création et suppression de factures #
#######################################
anim("Creation d'une facture")
try:
with conn.newFacture(adherent.dn, facture_ldif) as facture:
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")
if adherent:
anim("Creation d'une facture")
try:
with conn.search(u'fid=%s' % facture['fid'][0], mode='rw')[0] as facture:
facture.delete()
except Exception:
with conn.newFacture(adherent.dn, facture_ldif) as facture:
facture.create()
except Exception as error:
print ERREUR
print traceback.format_exc()
else: print OK
if show_traceback: print traceback.format_exc()
else: print "\t%r" % error
else:
print OK
anim("Suppression d'une facture")
try:
with conn.search(u'fid=%s' % facture['fid'][0], mode='rw')[0] as facture:
facture.delete()
except Exception:
print ERREUR
print traceback.format_exc()
else: print OK
############################
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment