From 3cf36346ab389a38c8a299953ddd228d25675663 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Sun, 24 Nov 2013 20:12:56 +0100 Subject: [PATCH] =?UTF-8?q?[test]=20Test=20de=20cr=C3=A9ation/suppression?= =?UTF-8?q?=20de=20factures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test.py | 50 ++++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/test.py b/test.py index a8e7d52..c7f967b 100755 --- a/test.py +++ b/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 -