Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 1daff1e7

Von Kivitendo Admin vor etwa 1 Jahr hinzugefügt

  • ID 1daff1e7f6506089b323901e995cec90dc5d35a7
  • Vorgänger e9e0a5c2
  • Nachfolger 8522e487

t/model/records.t - beim Löschen history_erp prüfen

Unterschiede anzeigen:

t/model/records.t
186 186
is(SL::DB::Manager::Order->get_all_count(where => [ quotation => 0 ]), 2, 'number of orders before delete ok');
187 187
is(SL::DB::Manager::DeliveryOrder->get_all_count(), 2, 'number of delivery orders before delete ok');
188 188
is(SL::DB::Manager::Reclamation->get_all_count(), 2, 'number of reclamations before delete ok');
189
is(SL::DB::Manager::Invoice->get_all_count(), 1, 'number of invoices before delete ok'); # no purchase_invoice was created
190

  
191
SL::Model::Record->delete($sales_quotation1);
192
SL::Model::Record->delete($sales_order1);
193
SL::Model::Record->delete($sales_reclamation1);
194
SL::Model::Record->delete($sales_invoice1);
195

  
196
SL::Model::Record->delete($purchase_quotation1);
197
SL::Model::Record->delete($purchase_order1);
198
SL::Model::Record->delete($purchase_reclamation1);
189
# is(SL::DB::Manager::Invoice->get_all_count(), 1, 'number of invoices before delete ok'); # no purchase_invoice was created
190

  
191
foreach my $record ( ($sales_quotation1,
192
                      $sales_order1,
193
                      $sales_reclamation1,
194
                      $purchase_quotation1,
195
                      $purchase_order1,
196
                      $purchase_reclamation1
197
                     )
198
                   ) {
199

  
200
  my $delete_return  = SL::Model::Record->delete($record);
201
  my $record_history = SL::DB::Manager::History->find_by(trans_id => $record->id, addition => 'DELETED');
202
  # just test if snumbers contains "_", not whether it actually is correct
203
  ok($record_history->snumbers =~ m/_/, "history snumbers of record " . $record_history->snumbers . " ok");
204
};
199 205

  
200 206
is(SL::DB::Manager::Order->get_all_count(where => [ quotation => 1 ]), 0, 'number of quotations after delete ok');
201 207
is(SL::DB::Manager::Order->get_all_count(where => [ quotation => 0 ]), 0, 'number of orders after delete ok');

Auch abrufbar als: Unified diff