Skip to content

Commit

Permalink
added test to cover partial update of UBO
Browse files Browse the repository at this point in the history
Co-authored-by: Iulian Masar <[email protected]>
  • Loading branch information
iulian03 and Iulian Masar authored Feb 25, 2025
1 parent 28fcb74 commit c294acb
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/test_ubos.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from datetime import date

from mangopay import constants
from mangopay.resources import UboDeclaration, Ubo
from mangopay.utils import Birthplace
from tests.test_base import BaseTestLive
from datetime import date


class UbosTests(BaseTestLive):
Expand Down Expand Up @@ -62,6 +63,19 @@ def test_update_ubo(self):
self.assertEqual(updated_ubo['nationality'], "GB")
self.assertEqual(updated_ubo["isActive"], True)

def test_update_ubo_partial(self):
to_be_updated = self.get_ubo(True)
to_be_updated.first_name = "updated fn"
to_be_updated.last_name = "updated ln"
updated_ubo = to_be_updated.save()

self.assertEqual(updated_ubo['first_name'], "updated fn")
self.assertEqual(updated_ubo['last_name'], "updated ln")
self.assertEqual(updated_ubo['birthday'], to_be_updated.birthday)
self.assertEqual(updated_ubo['birthplace'], to_be_updated.birthplace)
self.assertEqual(updated_ubo['address'], to_be_updated.address)


def test_get_ubo(self):
existing_ubo = self.get_ubo(True)
user = self.get_user_legal()
Expand Down

0 comments on commit c294acb

Please sign in to comment.