"""This module contains the test cases for the tasks of the ``accounts`` app"""

from mock import patch

from django.test.testcases import TestCase

from mtp.apps.accounts.management.commands.find_potential_duplicate_users import Command

from ..tasks import find_potential_duplicate_users


class FindPotentialDuplicateUsersTaskTestCase(TestCase):
    """Test case for the ``find_potential_duplicate_users`` test case"""

    def test_find_potential_duplicate_users_should_call_the_command(self):
        """Test that the task should call the django command"""

        with patch.object(Command, 'handle') as mocked_command:
            find_potential_duplicate_users.apply()

        mocked_command.assert_called_with(
            dryrun=False,
            interactive=False,
            no_color=False,
            pythonpath=None,
            settings=None,
            skip_checks=True,
            traceback=False,
            verbose=False,
            verbosity=1
        )
