Ejemplo n.º 1
0
 def test_id(self):
     from urls import router
     ff = FormFactory(router)
     html = ff.get('Book').render()
     print html
     self.assertTrue(
         re.search(r'<input .*?id="id_publication_date.*?/>', html))
Ejemplo n.º 2
0
 def test_select(self):
     from urls import router
     ff = FormFactory(router)
     book = ff.get('Book')
     publisher = book.get('publisher')
     publisher_html = publisher.render()
     print publisher_html
     self.assertTrue(publisher_html.find('r2b_dynamic') > 0)
     authors = book.get('authors')
     authors_html = authors.render()
     self.assertTrue(authors_html.find('select') > 0)
     print publisher_html
     print authors_html
Ejemplo n.º 3
0
    def test_select(self):
        from urls import router
        ff = FormFactory(router)
        book = ff.get('Book')

        publisher = book.get('publisher')
        publisher_html = publisher.render()
        print publisher_html
        self.assertTrue(publisher_html.find('r2b_dynamic') > 0)
        authors = book.get('authors')
        authors_html = authors.render()
        self.assertTrue(authors_html.find('select') > 0)
        print publisher_html
        print authors_html
Ejemplo n.º 4
0
 def test_html5(self):
     from urls import router
     ff = FormFactory(router)
     email = ff.get('Author').get('email').render()
     self.assertTrue(email.find('type="email') > 0)
     date = ff.get('Book').get('publication_date').render()
     self.assertTrue(date.find('type="date') > 0, date)
     time = ff.get('Book').get('publication_time').render()
     self.assertTrue(time.find('type="time') > 0)
     number = ff.get('Book').get('num_pages').render()
     self.assertTrue(number.find('type="number') > 0)
     self.assertTrue(number.find('min="1"') > 0)
     self.assertTrue(number.find('max="99999"') > 0)
     number = ff.get('Book').get('rating').render()
     self.assertTrue(number.find('type="number') > 0)
     url = ff.get('Publisher').get('website').render()
     self.assertTrue(url.find('type="url') > 0)
Ejemplo n.º 5
0
 def test_html5(self):
     from urls import router
     ff = FormFactory(router)
     email = ff.get('Author').get('email').render()
     self.assertTrue(email.find('type="email') > 0)
     date = ff.get('Book').get('publication_date').render()
     self.assertTrue(date.find('type="date') > 0, date)
     time = ff.get('Book').get('publication_time').render()
     self.assertTrue(time.find('type="time') > 0)
     number = ff.get('Book').get('num_pages').render()
     self.assertTrue(number.find('type="number') > 0)
     self.assertTrue(number.find('min="1"') > 0)
     self.assertTrue(number.find('max="99999"') > 0)
     number = ff.get('Book').get('rating').render()
     self.assertTrue(number.find('type="number') > 0)
     url = ff.get('Publisher').get('website').render()
     self.assertTrue(url.find('type="url') > 0)
Ejemplo n.º 6
0
 def test_js(self):
     from urls import router
     ff = FormFactory(router)
     html = ff.get('Book').render()
     self.assertTrue(re.search('<script>.*options', html, re.DOTALL))
Ejemplo n.º 7
0
 def test_id(self):
     from urls import router
     ff = FormFactory(router) 
     html = ff.get('Book').render()
     print html
     self.assertTrue(re.search(r'<input .*?id="id_publication_date.*?/>', html))
Ejemplo n.º 8
0
 def test_js(self):
     from urls import router
     ff = FormFactory(router) 
     html = ff.get('Book').render()
     self.assertTrue(re.search('<script>.*options', html, re.DOTALL))