From 9d55ee40f997f251c6a347737dc19cb01414f18c Mon Sep 17 00:00:00 2001 From: ai-bot Date: Sat, 14 Nov 2026 16:13:54 +0000 Subject: [PATCH] Assert the buy kept its sats, so only the sale consumed --- tests/test_tax.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_tax.py b/tests/test_tax.py index 953a4e8..e14fa91 100644 --- a/tests/test_tax.py +++ b/tests/test_tax.py @@ -206,6 +206,10 @@ class TaxTestCase(unittest.TestCase): self.assertEqual(lots[0]["cost_ore_original"], 20050000) self.assertEqual(lots[1]["sats_original"], 99900000) self.assertEqual(lots[1]["cost_ore_original"], 20000000) + # The buy must not have consumed anything: its sats fee only lowered the + # sats it received, so the second lot is untouched. + self.assertEqual(lots[0]["sats_remaining"], 0) + self.assertEqual(lots[1]["sats_remaining"], 99900000) # Proceeds 300 000 kr minus the 1 000 kr fee, cost 200 500 kr (FIFO). self.assertEqual(tax.report(2024)["totals"]["gevinst_ore"], 9850000)