Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • cde5674
  • /
  • services
  • /
  • ticketing
  • /
  • test_user_check_in.py
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge
swh:1:cnt:df2f4b9a219b93187331127bc51cb062409db34a
directory badge
swh:1:dir:6c9f2cae3f10bb49db604cd8bd39cbd73b671d2d

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
test_user_check_in.py
"""
:Copyright: 2014-2025 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""

import pytest

from byceps.database import db
from byceps.services.ticketing import (
    ticket_creation_service,
    ticket_service,
    ticket_user_checkin_service,
)


@pytest.fixture()
def ticket(admin_app, category, ticket_owner):
    return ticket_creation_service.create_ticket(category, ticket_owner)


def test_check_in_user(admin_app, party, ticket, ticketing_admin, make_user):
    ticket_user = make_user()
    initiator = ticketing_admin

    ticket_before = ticket

    ticket_before.used_by_id = ticket_user.id
    db.session.commit()

    assert not ticket_before.user_checked_in

    # -------------------------------- #

    ticket_id = ticket_before.id

    check_in_result = ticket_user_checkin_service.check_in_user(
        party.id, ticket_id, initiator
    )
    assert check_in_result.is_ok()

    check_in_result.unwrap()

    # -------------------------------- #

    ticket_after = ticket_service.get_ticket(ticket_id)
    assert ticket_after.user_checked_in

    check_in = ticket_user_checkin_service.find_check_in_for_ticket(ticket_id)
    assert check_in is not None
    assert check_in.occurred_at is not None
    assert check_in.initiator_id == initiator.id

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API