mirror of
https://github.com/Crocmagnon/charasheet.git
synced 2024-11-16 19:51:23 +01:00
parent
0b1b2ceb00
commit
f8f546679c
2 changed files with 30 additions and 1 deletions
|
@ -93,7 +93,7 @@ class CharacterQuerySet(models.QuerySet):
|
|||
Q(player=user)
|
||||
| Q(parties__in=Party.objects.related_to(user))
|
||||
| Q(invites__in=Party.objects.related_to(user))
|
||||
)
|
||||
).distinct()
|
||||
|
||||
|
||||
DEFAULT_NOTES = """
|
||||
|
|
|
@ -64,3 +64,32 @@ def test_gm_observe_invited_character_in_group(
|
|||
).click()
|
||||
title = selenium.find_element(By.TAG_NAME, "h1").text.strip()
|
||||
assert title == character.name
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_gm_observe_invited_character_in_two_groups(
|
||||
selenium: WebDriver, live_server: LiveServer
|
||||
):
|
||||
call_command("loaddata", "initial_data")
|
||||
|
||||
username, password = "gm", "password"
|
||||
gm = User.objects.create_user(username, password=password)
|
||||
player = User.objects.create_user("player")
|
||||
party = baker.make(Party, game_master=gm)
|
||||
other_party = baker.make(Party, game_master=gm)
|
||||
character = baker.make(Character, player=player)
|
||||
party.invited_characters.add(character)
|
||||
other_party.invited_characters.add(character)
|
||||
|
||||
selenium.get(live_server.url)
|
||||
login(selenium, username, password)
|
||||
|
||||
selenium.get(live_server.url + reverse("party:list"))
|
||||
selenium.find_element(
|
||||
By.CSS_SELECTOR, f".party[data-id='{party.pk}'] .access"
|
||||
).click()
|
||||
selenium.find_element(
|
||||
By.CSS_SELECTOR, f".character[data-id='{character.pk}'] .observe"
|
||||
).click()
|
||||
title = selenium.find_element(By.TAG_NAME, "h1").text.strip()
|
||||
assert title == character.name
|
||||
|
|
Loading…
Reference in a new issue