Пример #1
0
 def test_delete(self):
     self.set_up()
     self.add_test_data()
     uebersicht_depotwerte.index(
         VersionedPostRequest({
             'action': 'delete',
             'delete_index': '1'
         }))
     depotwerte = persisted_state.database_instance().depotwerte
     assert len(depotwerte.content) == 1
     assert depotwerte.get(0) == {
         'Name': 'depotwert1',
         'ISIN': 'isin1',
         'index': 0
     }
Пример #2
0
    def test_should_list_depotwerte(self):
        self.set_up()
        self.add_test_data()

        result = uebersicht_depotwerte.index(GetRequest())

        assert result['depotwerte'] == [{
            'index': 0,
            'name': 'depotwert1',
            'isin': 'isin1',
            'buchung': '100,00',
            'difference': '-10,00',
            'difference_is_negativ': True,
            'wert': '90,00'
        }, {
            'index': 1,
            'name': 'depotwert2',
            'isin': 'isin2',
            'buchung': '0,00',
            'difference': '0,00',
            'difference_is_negativ': False,
            'wert': '0,00'
        }]

        assert result['gesamt'] == {
            'buchung': '100,00',
            'difference': '-10,00',
            'difference_is_negativ': True,
            'wert': '90,00'
        }
Пример #3
0
    def test_delete_should_only_fire_once(self):
        self.set_up()
        self.add_test_data()
        next_id = request_handler.current_key()

        assert len(persisted_state.database_instance().depotwerte.content) == 2
        uebersicht_depotwerte.index(
            PostRequest({
                'action': 'delete',
                'delete_index': '1',
                'ID': next_id
            }))
        assert len(persisted_state.database_instance().depotwerte.content) == 1
        uebersicht_depotwerte.index(
            PostRequest({
                'action': 'delete',
                'delete_index': '1',
                'ID': next_id
            }))
        assert len(persisted_state.database_instance().depotwerte.content) == 1
Пример #4
0
def display_uebersicht_depowerte():
    return uebersicht_depotwerte.index(request)
Пример #5
0
 def test_init_filledDatabase(self):
     self.set_up()
     self.add_test_data()
     uebersicht_depotwerte.index(GetRequest())
Пример #6
0
 def test_init_withEmptyDatabase(self):
     self.set_up()
     uebersicht_depotwerte.index(GetRequest())
Пример #7
0
 def test_transaction_id_should_be_in_context(self):
     self.set_up()
     context = uebersicht_depotwerte.index(GetRequest())
     assert 'ID' in context