Beispiel #1
0
    def test_other_company_registration_number_kwarg(self):
        assert "otherCompanyRegistrationNumber" not in api_stubs.supplier(
        )["suppliers"]

        supplier = api_stubs.supplier(other_company_registration_number=123456)
        assert supplier["suppliers"][
            "otherCompanyRegistrationNumber"] == 123456
        assert "companiesHouseNumber" not in supplier["suppliers"]
Beispiel #2
0
 def test_default_values(self):
     assert api_stubs.supplier() == {
         'suppliers': {
             'companyDetailsConfirmed':
             True,
             'companiesHouseNumber':
             '12345678',
             'contactInformation': [{
                 'address1': '123 Fake Road',
                 'city': 'Madeupolis',
                 'contactName': 'Mr E Man',
                 'email': '*****@*****.**',
                 'id': 4321,
                 'links': {
                     'self':
                     'http://localhost:5000/suppliers/1234/contact-information/4321'
                 },
                 'phoneNumber': '01234123123',
                 'postcode': 'A11 1AA',
                 "website": "https://www.mre.company"
             }],
             'description':
             "I'm a supplier.",
             'dunsNumber':
             '123456789',
             'id':
             1234,
             'links': {
                 'self': 'http://localhost:5000/suppliers/1234'
             },
             'name':
             'My Little Company',
             'organisationSize':
             'micro',
             'registeredName':
             'My Little Registered Company',
             'registrationCountry':
             'country:GB',
             'service_counts': {
                 "G-Cloud 9": 109,
                 "G-Cloud 8": 108,
                 "G-Cloud 7": 107,
                 "G-Cloud 6": 106,
                 "G-Cloud 5": 105,
             },
             'tradingStatus':
             'limited company',
             'vatNumber':
             '111222333'
         }
     }
Beispiel #3
0
 def test_contact_id_kwarg_changes_contact_dictionary(self):
     brief = api_stubs.supplier(contact_id=9999)
     assert brief["suppliers"]["contactInformation"][0]["id"] == 9999
     assert brief["suppliers"]["contactInformation"][0]["links"][
         "self"].endswith("9999")
Beispiel #4
0
 def test_id_kwarg_changes_id_and_self_link(self):
     supplier = api_stubs.supplier(id=9999)
     assert supplier["suppliers"]["id"] == 9999
     assert supplier["suppliers"]["links"]["self"].endswith("9999")
Beispiel #5
0
 def test_returns_mapping_which_can_be_changed_using_kwargs(
         self, kwarg, key, value):
     assert key in api_stubs.supplier()["suppliers"]
     assert api_stubs.supplier(**{kwarg: value})["suppliers"][key] == value