File: test_individual_details.py

package info (click to toggle)
python-braintree 3.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,376 kB
  • ctags: 1,998
  • sloc: python: 13,634; makefile: 73; sh: 8
file content (20 lines) | stat: -rw-r--r-- 818 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from tests.test_helper import *

class TestIndividualDetails(unittest.TestCase):
    def test_repr_has_all_fields(self):
        details = IndividualDetails({
            "first_name": "Sue",
            "last_name": "Smith",
            "email": "sue@hotmail.com",
            "phone": "1112223333",
            "date_of_birth": "1980-12-05",
            "ssn_last_4": "5555",
            "address": {
                "street_address": "123 First St",
            }
        })

        regex = "<IndividualDetails {first_name: 'Sue', last_name: 'Smith', email: 'sue@hotmail.com', phone: '1112223333', date_of_birth: '1980-12-05', ssn_last_4: '5555', address_details: <AddressDetails {street_address: '123 First St'} at \w+>} at \w+>"

        matches = re.match(regex, repr(details))
        self.assertTrue(matches)