Beispiel #1
0
 def setUp(self):
     self.xfer_class = XferContainerAcknowledge
     LucteriosTest.setUp(self)
     rmtree(get_user_dir(), True)
     default_season()
     default_params()
     set_parameters(
         ["team", "activite", "age", "licence", "genre", 'numero', 'birth'])
Beispiel #2
0
 def setUp(self):
     LucteriosTest.setUp(self)
     rmtree(get_user_dir(), True)
     default_season()
     default_params()
     default_adherents()
     default_event_params()
     set_parameters(["team", "activite", "age", "licence", "genre", 'numero', 'birth'])
Beispiel #3
0
 def setUp(self):
     self.xfer_class = XferContainerAcknowledge
     LucteriosTest.setUp(self)
     rmtree(get_user_dir(), True)
     default_financial()
     default_season()
     default_params()
     default_adherents()
     default_subscription()
     default_event_params()
     set_parameters(
         ["team", "activite", "age", "licence", "genre", 'numero', 'birth'])
     add_default_degree()
Beispiel #4
0
    def test_prestation(self):
        default_financial()
        default_season()
        default_params()

        self.factory.xfer = SeasonSubscription()
        self.calljson('/diacamma.member/seasonSubscription', {}, False)
        self.assert_observer('core.custom', 'diacamma.member',
                             'seasonSubscription')
        self.assert_count_equal('', 9)
        self.assert_json_equal('TAB', '__tab_1', 'Saison')
        self.assert_json_equal('TAB', '__tab_2', 'Les cotisations')
        self.assert_json_equal('TAB', '__tab_3', 'Les prestations')
        self.assertFalse('__tab_4' in self.json_data.keys(),
                         self.json_data.keys())
        self.assert_grid_equal(
            'prestation', {
                'name': "nom",
                'description': "description",
                'team': "group",
                'activity': "passion",
                'article.price': "prix"
            }, 0)

        self.factory.xfer = PrestationAddModify()
        self.calljson('/diacamma.member/prestationAddModify', {}, False)
        self.assert_observer('core.custom', 'diacamma.member',
                             'prestationAddModify')
        self.assert_count_equal('', 6)

        self.factory.xfer = PrestationAddModify()
        self.calljson(
            '/diacamma.member/prestationAddModify', {
                'SAVE': 'YES',
                'name': 'abc123',
                'description': 'blablabla',
                'team': 3,
                'activity': 2,
                'article': 1
            }, False)
        self.assert_observer('core.acknowledge', 'diacamma.member',
                             'prestationAddModify')

        self.factory.xfer = SeasonSubscription()
        self.calljson('/diacamma.member/seasonSubscription', {}, False)
        self.assert_observer('core.custom', 'diacamma.member',
                             'seasonSubscription')
        self.assert_count_equal('prestation', 1)
        self.assert_json_equal('', 'prestation/@0/name', "abc123")
        self.assert_json_equal('', 'prestation/@0/description', "blablabla")
        self.assert_json_equal('', 'prestation/@0/team', "team3")
        self.assert_json_equal('', 'prestation/@0/activity', "activity2")
        self.assert_json_equal('', 'prestation/@0/article.price', 12.34)

        self.factory.xfer = PrestationDel()
        self.calljson('/diacamma.member/prestationDel', {
            "prestation": 1,
            'CONFIRME': 'YES'
        }, False)
        self.assert_observer('core.acknowledge', 'diacamma.member',
                             'prestationDel')

        self.factory.xfer = SeasonSubscription()
        self.calljson('/diacamma.member/seasonSubscription', {}, False)
        self.assert_observer('core.custom', 'diacamma.member',
                             'seasonSubscription')
        self.assert_count_equal('prestation', 0)