# Path: src/moviesapp/tests/base.py
# class BaseTestCase(TestCase):
#     fixtures = [
#         "lists.json",
#         "actions.json",
#         "users.json",
#     ]
# 
#     USER_USERNAME = "neo"
#     USER_PASSWORD = "password"
#     # Superuser - admin/adminpassword
#     # Another user - fox/password
# 
#     @staticmethod
#     def get_content(response):
#         return response.content.decode("utf-8")
# 
#     @staticmethod
#     def get_soup(response):
#         return BeautifulSoup(response.content, features="html.parser")
# 
#     def get_json(self, response):
#         return json.loads(self.get_content(response))
# 
#     def setUp(self):
#         User = get_user_model()
#         self.user = User.objects.get(username=self.USER_USERNAME)
# 
#         # Make sure we have current dates in action
#         action_records = ActionRecord.objects.all()
#         for action_record in action_records:
#             action_record.date = datetime.now(pytz.utc)
#             action_record.save()
# 
#     def login(self, username=None):
#         if username is None:
#             username = self.USER_USERNAME
#         self.client.logout()
#         self.client.login(username=username, password=self.USER_PASSWORD)
# 
#     @staticmethod
#     def load_json(filename):
#         base_path = os.path.join(settings.SRC_DIR, "moviesapp", "tests", "files")
#         path = os.path.join(base_path, filename)
#         with open(path, encoding="utf8") as f:
#             return json.load(f)
# 
#     @staticmethod
#     def dump_instance(instance):
#         return json.dumps(model_to_dict(instance), cls=DjangoJSONEncoder)


import pytest
import tmdbsimple
from django.urls import reverse
from flexmock import flexmock
from .base import BaseTestCase



class SearchMoviesAnonymousTestCase(BaseTestCase):
    response_type_movie = None
    response_type_movie_popular = None
    response_type_movie_sorted = None
    response_type_actor = None
    response_type_director = None

    def test_search_view(self):
        url = reverse("search")

# Path: src/moviesapp/tests/base.py
# class BaseTestCase(TestCase):
#     fixtures = [
#         "lists.json",
#         "actions.json",
#         "users.json",
#     ]
# 
#     USER_USERNAME = "neo"
#     USER_PASSWORD = "password"
#     # Superuser - admin/adminpassword
#     # Another user - fox/password
# 
#     @staticmethod
#     def get_content(response):
#         return response.content.decode("utf-8")
# 
#     @staticmethod
#     def get_soup(response):
#         return BeautifulSoup(response.content, features="html.parser")
# 
#     def get_json(self, response):
#         return json.loads(self.get_content(response))
# 
#     def setUp(self):
#         User = get_user_model()
#         self.user = User.objects.get(username=self.USER_USERNAME)
# 
#         # Make sure we have current dates in action
#         action_records = ActionRecord.objects.all()
#         for action_record in action_records:
#             action_record.date = datetime.now(pytz.utc)
#             action_record.save()
# 
#     def login(self, username=None):
#         if username is None:
#             username = self.USER_USERNAME
#         self.client.logout()
#         self.client.login(username=username, password=self.USER_PASSWORD)
# 
#     @staticmethod
#     def load_json(filename):
#         base_path = os.path.join(settings.SRC_DIR, "moviesapp", "tests", "files")
#         path = os.path.join(base_path, filename)
#         with open(path, encoding="utf8") as f:
#             return json.load(f)
# 
#     @staticmethod
#     def dump_instance(instance):
#         return json.dumps(model_to_dict(instance), cls=DjangoJSONEncoder)


# Path: src/moviesapp/tests/test_search.py
import pytest
import tmdbsimple
from django.urls import reverse
from flexmock import flexmock
from .base import BaseTestCase




class SearchMoviesAnonymousTestCase(BaseTestCase):
    response_type_movie = None
    response_type_movie_popular = None
    response_type_movie_sorted = None
    response_type_actor = None
    response_type_director = None

    def test_search_view(self):
        url = reverse("search")

        self.client.get(url)