<commit_before>from app.models import Users
from app.service import UsersService
from app.service_tests.service_test_case import ServiceTestCase


class UsersServiceTests(ServiceTestCase):
    # mark_user_as_authenticated tests #
    def test_mark_user_as_authenticated(self):
        email='<EMAIL>'
        user = Users(
            email=email,
            nickname='phil',
            password='<PASSWORD>'
        )
        UsersService.add_user_to_database(user)

        UsersService.mark_user_as_authenticated(user)

        user_again = UsersService.get_user_with_email(email)

        self.assertTrue(user_again.authenticated)

    # mark_user_as_not_authenticated tests #
    def test_mark_user_as_not_authenticated(self):
        email = '<EMAIL>'
        user = Users(
            email=email,
            nickname='phil',
            password='<PASSWORD>'
        )
        UsersService.add_user_to_database(user)

        UsersService.mark_user_as_authenticated(user)

        user_again = UsersService.get_user_with_email(email)

        self.assertTrue(user_again.authenticated)  # need to make sure user gets authenticated in the first place

        UsersService.mark_user_as_not_authenticated(user_again)

        users_again_again = UsersService.get_user_with_email(email)

        self.assertFalse(users_again_again.authenticated)<commit_msg>Formatting<commit_after>from app.models import Users
from app.service import UsersService
from app.service_tests.service_test_case import ServiceTestCase


class UsersServiceTests(ServiceTestCase):
    # mark_user_as_authenticated tests #
    def test_mark_user_as_authenticated(self):
        email = '<EMAIL>'
        user = Users(
            email=email,
            nickname='phil',
            password='<PASSWORD>'
        )
        UsersService.add_user_to_database(user)
        UsersService.mark_user_as_authenticated(user)
        user_again = UsersService.get_user_with_email(email)

        self.assertTrue(user_again.authenticated)

    # mark_user_as_not_authenticated tests #
    def test_mark_user_as_not_authenticated(self):
        email = '<EMAIL>'
        user = Users(
            email=email,
            nickname='phil',
            password='<PASSWORD>'
        )
        UsersService.add_user_to_database(user)
        UsersService.mark_user_as_authenticated(user)
        user_again = UsersService.get_user_with_email(email)

        self.assertTrue(user_again.authenticated)  # need to make sure user gets authenticated in the first place

        UsersService.mark_user_as_not_authenticated(user_again)
        users_again_again = UsersService.get_user_with_email(email)

        self.assertFalse(users_again_again.authenticated)
{'fraction_non_alphanumeric': 0.07200587803085966, 'fraction_numerical': 0.0, 'mean_word_length': 3.1763803680981595, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6425714', 'n_tokens_mistral': 811, 'n_tokens_neox': 774, 'n_words': 120}