Exemplo n.º 1
0
    def form_document_loading():

        index_node = StringFields(title=u'Numéro de facture',
                                  name='index',
                                  l_choices=zip(Facture.get_facture(),
                                                Facture.get_facture()))
        document_node = StringFields(title=u'Nom document',
                                     name='document',
                                     l_choices=Facturation.l_documents)

        return {'nodes': [document_node.sn, index_node.sn]}
Exemplo n.º 2
0
    def test_request(self):
        """
        python -m unittest tests.models.facture.TestFacture.test_request

        """
        l_facture = Facture.get_facture(path=self.path)
        self.assertEqual(len(l_facture), 1)
        self.assertEqual(l_facture[0], self.facture_id)

        # Test from index instance method
        test_facture = Facture.from_index_({'facture_id': self.facture_id},
                                           path=self.path)

        for k, v in self.d_init[0].items():
            if k not in [sch.name for sch in BaseModel.l_hfields]:
                self.assertEqual(test_facture.__getattribute__(k), v)