Skip to content

Commit

Permalink
fix(Asset): Remove redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
GangaManoj committed Jun 24, 2021
1 parent 60a44ae commit 550fe8a
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions erpnext/assets/doctype/asset/test_asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,8 @@ def test_schedule_for_double_declining_method(self):
"frequency_of_depreciation": 12,
"depreciation_start_date": '2030-12-31'
})
asset.insert()
self.assertEqual(asset.status, "Draft")
asset.save()
self.assertEqual(asset.status, "Draft")

expected_schedules = [
['2030-12-31', 66667.00, 66667.00],
Expand Down Expand Up @@ -184,7 +183,7 @@ def test_schedule_for_double_declining_method_for_existing_asset(self):
"frequency_of_depreciation": 12,
"depreciation_start_date": "2030-12-31"
})
asset.insert()
asset.save()
self.assertEqual(asset.status, "Draft")

expected_schedules = [
Expand Down Expand Up @@ -215,7 +214,6 @@ def test_schedule_for_prorated_straight_line_method(self):
"depreciation_start_date": "2030-12-31"
})

asset.insert()
asset.save()

expected_schedules = [
Expand Down Expand Up @@ -246,7 +244,6 @@ def test_depreciation(self):
"frequency_of_depreciation": 10,
"depreciation_start_date": "2020-12-31"
})
asset.insert()
asset.submit()
asset.load_from_db()
self.assertEqual(asset.status, "Submitted")
Expand Down Expand Up @@ -349,7 +346,6 @@ def test_depreciation_entry_cancellation(self):
"frequency_of_depreciation": 10,
"depreciation_start_date": "2020-12-31"
})
asset.insert()
asset.submit()
post_depreciation_entries(date="2021-01-01")

Expand Down Expand Up @@ -379,7 +375,6 @@ def test_scrap_asset(self):
"total_number_of_depreciations": 10,
"frequency_of_depreciation": 1
})
asset.insert()
asset.submit()

post_depreciation_entries(date=add_months('2020-01-01', 4))
Expand Down Expand Up @@ -423,7 +418,6 @@ def test_asset_sale(self):
"frequency_of_depreciation": 10,
"depreciation_start_date": "2020-12-31"
})
asset.insert()
asset.submit()
post_depreciation_entries(date="2021-01-01")

Expand Down Expand Up @@ -467,7 +461,7 @@ def test_asset_expected_value_after_useful_life(self):
"total_number_of_depreciations": 3,
"frequency_of_depreciation": 10
})
asset.insert()
asset.save()
accumulated_depreciation_after_full_schedule = \
max(d.accumulated_depreciation_amount for d in asset.get("schedules"))

Expand Down

0 comments on commit 550fe8a

Please sign in to comment.