示例#1
0
    def test_aendere_beiVollerDatenbank(self):
        component_under_test = Dauerauftraege()
        component_under_test.add(datum('1.1.2010'), date.today(),
                                 '1some kategorie', '1some name',
                                 '1some rhythmus', 1.23)
        component_under_test.add(datum('1.1.2010'), date.today(),
                                 '2some kategorie', '2some name',
                                 '2some rhythmus', 1.23)
        component_under_test.add(datum('1.1.2010'), date.today(),
                                 '3some kategorie', '3some name',
                                 '3some rhythmus', 1.23)

        component_under_test.edit(1, datum('2.1.2010'), datum('3.1.2010'),
                                  'some other kategorie', 'some other name',
                                  'some other rhythmus', 2.34)

        assert len(component_under_test.content) == 3
        assert component_under_test.content.Startdatum[1] == datum('2.1.2010')
        assert component_under_test.content.Endedatum[1] == datum('3.1.2010')
        assert component_under_test.content.Name[1] == 'some other name'
        assert component_under_test.content.Kategorie[
            1] == 'some other kategorie'
        assert component_under_test.content.Rhythmus[
            1] == 'some other rhythmus'
        assert component_under_test.content.Wert[1] == 2.34
示例#2
0
 def test_edit_shouldTaint(self):
     component_under_test = Dauerauftraege()
     component_under_test.add(datum('1.1.2010'), date.today(),
                              'some kategorie', 'some name',
                              'some rhythmus', 1.23)
     component_under_test.de_taint()
     assert component_under_test.taint_number() == 0
     component_under_test.edit(0, datum('2.1.2010'), datum('3.1.2010'),
                               'some other kategorie', 'some other name',
                               'some other rhythmus', 2.34)
     assert component_under_test.taint_number() == 1