def _CreateUserAndDevice(self, user_dict, ident_dict, device_dict=None):
    # Allocate web device id.
    webapp_dev_id = self._RunAsync(Device._allocator.NextId, self._client)

    # Create prospective user.
    user, identity = self._RunAsync(User.CreateProspective,
                                    self._client,
                                    user_dict['user_id'],
                                    webapp_dev_id,
                                    ident_dict['key'],
                                    util._TEST_TIME)

    # Register the user.
    user = self._RunAsync(User.Register,
                          self._client,
                          user_dict,
                          ident_dict,
                          util._TEST_TIME,
                          rewrite_contacts=True)

    # Register the device.
    if device_dict is not None:
      device = self._RunAsync(Device.Register, self._client, user.user_id, device_dict, is_first=True)
    else:
      device = None

    return (user, device)
Creates a new, registered user from the fields in "user_dict". If "device_dict" is
dataset/ETHPy150Open viewfinderco/viewfinder/backend/db/test/base_test.py/DBBaseTestCase._CreateUserAndDevice