<commit_before>import re
from .. import factories as f


def test_profile_flow(base_url, browser, outbox):
    user = f.create_user(username='profile1')
    user.set_password('<PASSWORD>')
    user.save()
    url = base_url + '/workshop/'
    browser.visit(url)
    browser.fill('login', user.email)
    browser.fill('password', '<PASSWORD>')
    browser.find_by_css('[type=submit]')[0].click()
    assert len(outbox) == 1
    mail = outbox[0]
    confirm_link = re.findall(r'http.*/accounts/.*/', mail.body)
    assert confirm_link
    browser.visit(confirm_link[0])
    assert browser.title, "Confirm E-mail Address"
    browser.find_by_css('[type=submit]')[0].click()

    url = base_url + '/accounts/login/'
    browser.visit(url)
    browser.fill('login', user.email)
    browser.fill('password', '<PASSWORD>')
    browser.find_by_css('[type=submit]')[0].click()

    poc_type = f.create_usertype(slug='dummy', display_name='College POC')
    section1 = f.create_workshop_section(name='section1')
    location1 = f.create_locaiton(name='location1')
    url = base_url + '/profile/{}/'.format(user.username)
    browser.visit(url)

    url = base_url + '/profile/{}/edit'.format(user.username)
    browser.visit(url)
    browser.fill('mobile', "1234567890")
    browser.select('usertype', poc_type.id)
    browser.select('interested_sections', section1.id)
    browser.select('interested_locations', location1.id)
    browser.select('location', location1.id)
    browser.find_by_css('[type=submit]')[0].click()<commit_msg>tests(test_profile_flow): added logout profile flow<commit_after>import re
from .. import factories as f


def test_profile_flow(base_url, browser, outbox):
    user = f.create_user(username='profile1')
    user.set_password('<PASSWORD>')
    user.save()
    url = base_url + '/workshop/'
    browser.visit(url)
    browser.fill('login', user.email)
    browser.fill('password', '<PASSWORD>')
    browser.find_by_css('[type=submit]')[0].click()
    assert len(outbox) == 1
    mail = outbox[0]
    confirm_link = re.findall(r'http.*/accounts/.*/', mail.body)
    assert confirm_link
    browser.visit(confirm_link[0])
    assert browser.title, "Confirm E-mail Address"
    browser.find_by_css('[type=submit]')[0].click()

    url = base_url + '/accounts/login/'
    browser.visit(url)
    browser.fill('login', user.email)
    browser.fill('password', '<PASSWORD>')
    browser.find_by_css('[type=submit]')[0].click()

    poc_type = f.create_usertype(slug='dummy', display_name='College POC')
    section1 = f.create_workshop_section(name='section1')
    location1 = f.create_locaiton(name='location1')
    url = base_url + '/profile/{}/'.format(user.username)
    browser.visit(url)

    url = base_url + '/profile/{}/edit'.format(user.username)
    browser.visit(url)
    browser.fill('mobile', "1234567890")
    browser.select('usertype', poc_type.id)
    browser.select('interested_sections', section1.id)
    browser.select('interested_locations', location1.id)
    browser.select('location', location1.id)
    browser.find_by_css('[type=submit]')[0].click()

    assert browser.is_text_present('My Profile')
    assert browser.is_text_present('Graph')

    # Logging Out
    url = base_url + '/accounts/logout/'
    browser.visit(url)
    assert 'Home | PythonExpress' in browser.title
{'fraction_non_alphanumeric': 0.16335141651597349, 'fraction_numerical': 0.015069318866787222, 'mean_word_length': 4.218553459119497, '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': '959546', 'n_tokens_mistral': 1138, 'n_tokens_neox': 1105, 'n_words': 173}