From 8269629ce2ed62a61a28366a1794a530196d9fd3 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Fri, 15 Nov 2024 15:45:46 -0500 Subject: [PATCH] Have tests play nicely with each other --- .../posit/connect/test_content_item_permissions.py | 12 ++++++------ integration/tests/posit/connect/test_users.py | 8 ++++++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/integration/tests/posit/connect/test_content_item_permissions.py b/integration/tests/posit/connect/test_content_item_permissions.py index 2cf5badf..9742eaa4 100644 --- a/integration/tests/posit/connect/test_content_item_permissions.py +++ b/integration/tests/posit/connect/test_content_item_permissions.py @@ -11,14 +11,14 @@ def setup_class(cls): cls.content = cls.client.content.create(name="example") cls.user_aron = cls.client.users.create( - username="aron", - email="aron@example.com", - password="s3cur3p@ssword", + username="permission_aron", + email="permission_aron@example.com", + password="permission_s3cur3p@ssword", ) cls.user_bill = cls.client.users.create( - username="bill", - email="bill@example.com", - password="s3cur3p@ssword", + username="permission_bill", + email="permission_bill@example.com", + password="permission_s3cur3p@ssword", ) cls.group_friends = cls.client.groups.create(name="Friends") diff --git a/integration/tests/posit/connect/test_users.py b/integration/tests/posit/connect/test_users.py index e1f68498..aebf7cf0 100644 --- a/integration/tests/posit/connect/test_users.py +++ b/integration/tests/posit/connect/test_users.py @@ -5,6 +5,10 @@ class TestUser: @classmethod def setup_class(cls): cls.client = client = connect.Client() + + # Play nicely with other tests + cls.existing_users = client.users.count() + cls.aron = client.users.create( username="aron", email="aron@example.com", @@ -29,8 +33,8 @@ def test_lock(self): assert len(self.client.users.find(account_status="locked")) == 0 def test_count(self): - # aron, bill, cole, and me - assert self.client.users.count() == 4 + # aron, bill, cole, and me (and existing user) + assert self.client.users.count() == 3 + self.existing_users def test_find(self): assert self.client.users.find(prefix="aron") == [self.aron]