<commit_before>import unittest
from bucky import views
from bucky import create_app
from bucky.models import User


class TestViews(unittest.TestCase):
    def setUp(self):
        self.app = create_app('testing')
        self.app_context = self.app.app_context()
        self.app_context.push()
        self.client = self.app.test_client()

    def tearDown(self):
        self.app_context.pop()
    
    def test_register(self):
        initial_db_size = len(self.app.database)
        response = self.client.post('/register',
                                    data={'username': 'Oj', 'password': '<PASSWORD>'})
        self.assertTrue(response.status_code == 302)
        self.assertTrue(len(self.app.database) == initial_db_size +1)
    
    # def test_login(self):
    #     response = self.client.post('/login',
    #                                 data={'username': 'Oj', 'password': '<PASSWORD>'})
    #     self.assertIn(b'Oj', response.data)
    #     self.assertTrue(response.status_code == 302)
    #
    # def test_logout(self):
    #     response = self.client.get('/logout')
    #     self.assertTrue(response.status_code == 302)
    #     self.assertIn(b'Logged out', response.data)<commit_msg>Tests for Login<commit_after>import unittest
from bucky import views
from bucky import create_app
from bucky.models import User


class TestViews(unittest.TestCase):
    def setUp(self):
        self.app = create_app('testing')
        self.app_context = self.app.app_context()
        self.app_context.push()
        self.client = self.app.test_client()

    def tearDown(self):
        self.app_context.pop()
    
    def test_register(self):
        initial_db_size = len(self.app.database)
        response = self.client.post('/register',
                                    data={'username': 'Oj', 'password': '<PASSWORD>'})
        self.assertTrue(response.status_code == 302)
        self.assertTrue(len(self.app.database) == initial_db_size +1)
    
    def test_login(self):
        response = self.client.post('/login',
                                    data={'username': 'Oj', 'password': '<PASSWORD>'})
        self.assertIn(b'Oj', response.data)
        self.assertTrue(response.status_code == 302)
    #
    # def test_logout(self):
    #     response = self.client.get('/logout')
    #     self.assertTrue(response.status_code == 302)
    #     self.assertIn(b'Logged out', response.data)
{'fraction_non_alphanumeric': 0.13358147229114972, 'fraction_numerical': 0.008271298593879239, 'mean_word_length': 2.4656160458452723, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3995505', 'n_tokens_mistral': 743, 'n_tokens_neox': 728, 'n_words': 129}