def get_customer_name(self): """ Return the provider's customer name. Args: None Returns: (String): "Name of the customer", example: "Customer 1 Inc." """ obj = self._get_db_obj_query().first() customer_id = obj.customer_id customer_accessor = CustomerDBAccessor(customer_id) group_ptr_id = customer_accessor.get_group_ptr_id() auth_accessor = AuthDBAccessor(group_ptr_id) return auth_accessor.get_name()
def test_get_group_ptr_id(self): """Test provider name getter.""" customer_id = '1' accessor = CustomerDBAccessor(customer_id) self.assertEqual(1, accessor.get_group_ptr_id()) accessor.close_session()