<commit_before>from django.core.urlresolvers import reverse
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from splinter import Browser
from django.contrib.auth.models import User

class WidgetLogoutTest(StaticLiveServerTestCase):
    """
        Integration test suite for testing the views in the app: tosp_auth.

        Test if the widget log out are present.

        Attributes
        ----------
        browser : Browser
            Driver to navigate through websites and to run integration tests.
    """
    def setUp(self):
        """
            Initialize the browser and create a user, before running the tests.
        """
        self.browser = Browser('chrome')
        User.objects.create_user(
            username='thelma', email='<EMAIL>', password='<PASSWORD>')
    
    def tearDown(self):
        """
            At the end of tests, close the browser.
        """
        self.browser.quit()
        
    def test_option_does_not_appear(self):
        """
            Test: if the option log out appear for log users
        """
        self.client.login(username='thelma', password='<PASSWORD>')
        self.browser.visit(self.live_server_url)
        self.assertTrue(self.browser.is_text_present('Log Out'))
        
    def test_option_appear_to_no_logged_client(self):
        """
            Test: if the option log out appear for not log users
        """
        self.browser.visit(self.live_server_url)
        self.assertFalse(self.browser.is_text_present('Log Out'))<commit_msg>Changes requested for pull request<commit_after>from django.core.urlresolvers import reverse
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from splinter import Browser
from django.contrib.auth.models import User

class WidgetLogoutTest(StaticLiveServerTestCase):
    """Integration test suite for testing the views in the app: tosp_auth.

        Test if the widget log out are present.

        Attributes
        ----------
        browser : Browser
            Driver to navigate through websites and to run integration tests.
    """
    def setUp(self):
        """Initialize the browser and create a user, before running the tests.
        """
        self.browser = Browser('chrome')
        User.objects.create_user(
            username='thelma', email='<EMAIL>', password='<PASSWORD>')
    
    def tearDown(self):
        """At the end of tests, close the browser.
        """
        self.browser.quit()
        
    def test_option_does_not_appear(self):
        """Test: if the option log out appear for log users
        """
        self.client.login(username='thelma', password='<PASSWORD>')
        self.browser.visit(self.live_server_url)
        self.assertTrue(self.browser.is_text_present('Log Out'))
        
    def test_option_appear_to_no_logged_client(self):
        """Test: if the option log out appear for not log users
        """
        self.browser.visit(self.live_server_url)
        self.assertFalse(self.browser.is_text_present('Log Out'))
{'fraction_non_alphanumeric': 0.09664694280078895, 'fraction_numerical': 0.0, 'mean_word_length': 2.546620046620047, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3054675', 'n_tokens_mistral': 815, 'n_tokens_neox': 802, 'n_words': 229}