<reponame>Rey092/myhouse24_django
# import pytest
# from django.urls import reverse
# from src.users.models import User
#
#
# pytestmark = pytest.mark.django_db
#
#
# class TestUserAdmin:
#     def test_changelist(self, admin_client):
#         url = reverse("admin_panel:users_user_changelist")
#         response = admin_client.get(url)
#         assert response.status_code == 200
#
#     def test_search(self, admin_client):
#         url = reverse("admin_panel:users_user_changelist")
#         response = admin_client.get(url, data={"q": "test"})
#         assert response.status_code == 200
#
#     def test_add(self, admin_client):
#         url = reverse("admin_panel:users_user_add")
#         response = admin_client.get(url)
#         assert response.status_code == 200
#
#         response = admin_client.post(
#             url,
#             data={
#                 "username": "test",
#                 "password1": "<PASSWORD>",
#                 "password2": "<PASSWORD>",
#             },
#         )
#         assert response.status_code == 302
#         assert User.objects.filter(username="test").exists()
#
#     def test_view_user(self, admin_client):
#         user = User.objects.get(username="admin_panel")
#         url = reverse("admin_panel:users_user_change", kwargs={"object_id": user.pk})
#         response = admin_client.get(url)
#         assert response.status_code == 200

# import pytest
# from django.urls import reverse
# from src.users.models import User
#
#
# pytestmark = pytest.mark.django_db
#
#
# class TestUserAdmin:
#     def test_changelist(self, admin_client):
#         url = reverse("admin_panel:users_user_changelist")
#         response = admin_client.get(url)
#         assert response.status_code == 200
#
#     def test_search(self, admin_client):
#         url = reverse("admin_panel:users_user_changelist")
#         response = admin_client.get(url, data={"q": "test"})
#         assert response.status_code == 200
#
#     def test_add(self, admin_client):
#         url = reverse("admin_panel:users_user_add")
#         response = admin_client.get(url)
#         assert response.status_code == 200
#
#         response = admin_client.post(
#             url,
#             data={
#                 "username": "test",
#                 "password1": "<PASSWORD>",
#                 "password2": "<PASSWORD>",
#             },
#         )
#         assert response.status_code == 302
#         assert User.objects.filter(username="test").exists()
#
#     def test_view_user(self, admin_client):
#         user = User.objects.get(username="admin_panel")
#         url = reverse("admin_panel:users_user_change", kwargs={"object_id": user.pk})
#         response = admin_client.get(url)
#         assert response.status_code == 200
# import pytest # from django.urls import reverse # from src.users.models import User # # # pytestmark = pytest.mark.django_db # # # class TestUserAdmin: #     def test_changelist(self, admin_client): #         url = reverse("admin_panel:users_user_changelist") #         response = admin_client.get(url) #         assert response.status_code == 200 # #     def test_search(self, admin_client): #         url = reverse("admin_panel:users_user_changelist") #         response = admin_client.get(url, data={"q": "test"}) #         assert response.status_code == 200 # #     def test_add(self, admin_client): #         url = reverse("admin_panel:users_user_add") #         response = admin_client.get(url) #         assert response.status_code == 200 # #         response = admin_client.post( #             url, #             data={ #                 "username": "test", #                 "password1": "<PASSWORD>", #                 "password2": "<PASSWORD>", #             }, #         ) #         assert response.status_code == 302 #         assert User.objects.filter(username="test").exists() # #     def test_view_user(self, admin_client): #         user = User.objects.get(username="admin_panel") #         url = reverse("admin_panel:users_user_change", kwargs={"object_id": user.pk}) #         response = admin_client.get(url) #         assert response.status_code == 200