<commit_before># -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
from selenium_fixture import driver

def test_addfilm_without_year_field_set(app):
    app.go_to_homepage())
    app.login(User.Admin())
    app.driver.find_element_by_css_selector("img[alt=\"Add movie\"]").click()
    form = app.driver.find_element_by_id("updateform")
    form.find_element_by_name("name").clear()
    form.find_element_by_name("name").send_keys("Test film")
    form.find_element_by_name("year").clear()
    app.driver.find_element_by_css_selector("img[alt=\"Save\"]").click()
    assert app.is_element_present(By.CSS_SELECTOR, "img[alt=\"Save\"]") == True
    app.logout()

def test_addfilm_with_all_required_fields_set(app):
    app.go_to_homepage())
    app.login(User.Admin())
    app.driver.find_element_by_css_selector("img[alt=\"Add movie\"]").click()
    form = app.driver.find_element_by_id("updateform")
    form.find_element_by_name("name").clear()<commit_msg>Import model.user and fix selenium_fixture import.<commit_after># -*- coding: utf-8 -*-
from model.user import User
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
from selenium_fixture import app

def test_addfilm_without_year_field_set(app):
    app.go_to_homepage())
    app.login(User.Admin())
    app.driver.find_element_by_css_selector("img[alt=\"Add movie\"]").click()
    form = app.driver.find_element_by_id("updateform")
    form.find_element_by_name("name").clear()
    form.find_element_by_name("name").send_keys("Test film")
    form.find_element_by_name("year").clear()
    app.driver.find_element_by_css_selector("img[alt=\"Save\"]").click()
    assert app.is_element_present(By.CSS_SELECTOR, "img[alt=\"Save\"]") == True
    app.logout()

def test_addfilm_with_all_required_fields_set(app):
    app.go_to_homepage())
    app.login(User.Admin())
    app.driver.find_element_by_css_selector("img[alt=\"Add movie\"]").click()
    form = app.driver.find_element_by_id("updateform")
    form.find_element_by_name("name").clear()
{'fraction_non_alphanumeric': 0.1453965360072926, 'fraction_numerical': 0.0009115770282588879, 'mean_word_length': 5.591591591591592, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5595067', 'n_tokens_mistral': 752, 'n_tokens_neox': 733, 'n_words': 100}