from model_mommy import mommy


# def test_simple(timbrowser):
#     timbrowser.visit(timbrowser.url)
#     assert timbrowser.is_text_present('Timtec')


def test_login(timbrowser, user):
    b = timbrowser
    b.visit(b.url)
    b.find_by_xpath('//a[normalize-space(text())="Entrar"]').click()
    assert b.is_element_present_by_css('.open .dropdown-menu')
    b.fill('login', user.username)
    b.fill('password', 'password')
    b.find_by_css('.submit .btn-success').first.click()
    assert b.is_element_present_by_css('.username')


def test_courses_home(timbrowser):
    b = timbrowser
    mommy.make('Course', name='FindMe', home_published=True)

    b.visit(b.url)
    assert len(b.find_by_css('.course')) >= 1
    assert b.is_element_present_by_xpath('//h3[normalize-space(text())="FindMe"]')

@@ -176,36 +176,32 @@
 wser, user):%0A   
- b =
  timbrowser%0A    
@@ -199,33 +199,45 @@
 wser
-%0A    b
 .visit(
-b.url)%0A    b
+timbrowser.url)%0A    timbrowser
 .fin
@@ -304,72 +304,18 @@
     
-assert b.is_element_present_by_css('.open .dropdown-menu')%0A    b
+timbrowser
 .fil
@@ -344,17 +344,26 @@
 me)%0A    
-b
+timbrowser
 .fill('p
@@ -388,17 +388,26 @@
 d')%0A    
-b
+timbrowser
 .find_by
@@ -452,33 +452,42 @@
 ck()%0A    assert 
-b
+timbrowser
 .is_element_pres

fix browsers tests