[tests] do not store test data dependant on version number

authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
changesetdf2b0b0a6ba8
branchdefault
phasedraft
hiddenyes
parent revision#bda495d50558 supprime état de facturation (closes #261949)
child revision#1148b0d1d6b6 rapports configurables (closes #257021)
files modified by this revision
test/data/compte-resultat.xml
test/test_lib.py
# HG changeset patch
# User Nicolas Chauvat <nicolas.chauvat@logilab.fr>
# Date 1406809724 -7200
# Thu Jul 31 14:28:44 2014 +0200
# Node ID df2b0b0a6ba8baa1c77ecbf6f8a02547e6945c97
# Parent bda495d5055846ea390f0977e78e23475f057c1e
[tests] do not store test data dependant on version number

diff --git a/test/data/compte-resultat.xml b/test/data/compte-resultat.xml
@@ -1,7 +1,7 @@
1  <?xml version="1.0" encoding="ISO-8859-1"?>
2 -<!-- pycompta version 0.8.3 -->
3 +<!-- pycompta version %version% -->
4  <compte-resultat debut="2002-01-01" fin="2002-01-31">
5    <charges id="charges" montant="20000">
6      <poste id="1.1" nom="Charges d'exploitation" montant="20000">
7        <poste id="1.1.1" nom="Achats de marchandises" montant="20000">
8  	<compte num="607" credit="0" debit="20000" />
diff --git a/test/test_lib.py b/test/test_lib.py
@@ -498,11 +498,12 @@
9          self.glivre = entities.GrandLivre(self.journal)
10          self.resultat = entities.CompteResultat(self.glivre)
11          out = StringIO()
12          visitors.write_compte_resultat(out, self.resultat,
13                                         Date(2002,1,1), Date(2002,1,31))
14 -        expected = '\n'.join([line.strip() for line in file(self.datapath('compte-resultat.xml'))])
15 +        expected = '\n'.join([line.strip().replace('%version%', VERSION)
16 +                              for line in file(self.datapath('compte-resultat.xml'))])
17          result = '\n'.join([line.strip() for line in out.getvalue().splitlines()])
18          self.assertMultiLineEqual(expected, result)
19 
20 
21  # BILAN ########################################################################