def test_domain_admin_with_explicit_roles(self):
        api_key_with_explicit_permissions, _ = HQApiKey.objects.get_or_create(
            user=WebUser.get_django_user(self.domain_admin),
            name='explicit_with_permission',
            role_id=self.role_with_permission.get_id,
        )
        api_key_without_explicit_permissions, _ = HQApiKey.objects.get_or_create(
            user=WebUser.get_django_user(self.domain_admin),
            name='explicit_without_permission',
            role_id=self.role_without_permission.get_id,
        )
        self.assertAuthenticationSuccess(self.require_edit_data,
                                         self._get_request(
                                             domain=self.domain,
                                             HTTP_AUTHORIZATION=self._construct_api_auth_header(
                                                 self.domain_admin.username,
                                                 api_key_with_explicit_permissions
                                             )
                                         ))
        self.assertAuthenticationFail(self.require_edit_data,
                                      self._get_request(
                                          domain=self.domain,
                                          HTTP_AUTHORIZATION=self._construct_api_auth_header(
                                              self.domain_admin.username,
                                              api_key_without_explicit_permissions
                                          )
                                      ))