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


from mtp.apps.common.tests.test_cases import MTPTestCase

from ..forms import PasswordResetForm


class PasswordResetFormTestCase(MTPTestCase):
    """Test the methods of the ``PasswordResetForm`` form"""

    def test_get_users_should_not_return_the_deleted_users(self):
        """Test that the ``get_users`` method should not return the deleted users"""

        form = PasswordResetForm()

        # The trainee is not yet soft deleted
        users = form.get_users(self.trainee.email)
        self.assertEqual(list(users), [self.trainee])

        # Soft-delete the trainee
        self.trainee.remove()
        users = form.get_users(self.trainee.email)
        self.assertEqual(list(users), [])
