Exemple #1
0
    def test_delete(self):
        self.set_up()
        self.add_test_data()

        uebersicht_depotauszuege.index(
            VersionedPostRequest({
                'action': 'delete',
                'delete_index': '1'
            }))
        depotauszuege = persisted_state.database_instance().depotauszuege

        assert len(depotauszuege.content) == 2

        page_conent = uebersicht_depotauszuege._handle_request(GetRequest())
        assert page_conent['gesamt'] == [
            {
                'buchungen': [{
                    'depotwert': '1name (1isin)',
                    'wert': 1
                }],
                'index': 0,
                'name': '1demokonto vom 01.01.2020'
            },
            {
                'buchungen': [{
                    'depotwert': '4name (4isin)',
                    'wert': 4
                }],
                'index': 1,
                'name': '3demokonto vom 03.01.2020'
            },
        ]
Exemple #2
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().depotauszuege.content) == 4
        uebersicht_depotauszuege.index(
            PostRequest({
                'action': 'delete',
                'delete_index': '1',
                'ID': next_id
            }))
        assert len(
            persisted_state.database_instance().depotauszuege.content) == 2
        uebersicht_depotauszuege.index(
            PostRequest({
                'action': 'delete',
                'delete_index': '1',
                'ID': next_id
            }))
        assert len(
            persisted_state.database_instance().depotauszuege.content) == 2
Exemple #3
0
 def test_init_withEmptyDatabase(self):
     self.set_up()
     content = uebersicht_depotauszuege.index(GetRequest())
     assert content['gesamt'] == []
Exemple #4
0
 def test_transaction_id_should_be_in_context(self):
     self.set_up()
     context = uebersicht_depotauszuege.index(GetRequest())
     assert 'ID' in context
Exemple #5
0
def display_uebersicht_depotauszuege():
    return uebersicht_depotauszuege.index(request)