Commits

danjac  committed 72077b9

removed syntax errors from merge. Still number of breaking tests

  • Participants
  • Parent commits 4c13039
  • Branches colander

Comments (0)

Files changed (2)

File pyramid_simpleform/__init__.py

         return obj
 
 
-<<<<<<< local
-=======
-        charset = getattr(self.request, 'charset', 'utf-8')
-        htmlfill_kwargs.setdefault('encoding', charset)
-        return htmlfill.render(content, 
-                               defaults=self.data,
-                               errors=self.errors,
-                               **htmlfill_kwargs)
 
-    def render(self, template, extra_info=None, htmlfill=True,
-              **htmlfill_kwargs):
-        """
-        Renders the form directly to a template,
-        using Pyramid's **render** function. 
-
-        `template` : name of template
-
-        `extra_info` : dict of extra data to pass to template
-
-        `htmlfill` : run htmlfill on the result.
-
-        By default the form itself will be passed in as `form`.
-
-        htmlfill is automatically run on the result of render if
-        `htmlfill` is **True**.
-
-        This is useful if you want to use htmlfill on a form,
-        but still return a dict from a view. For example::
-
-            @view_config(name='submit', request_method='POST')
-            def submit(request):
-
-                form = Form(request, MySchema)
-                if form.validate():
-                    # do something
-                return dict(form=form.render("my_form.html"))
-
-        """
-        
-        extra_info = extra_info or {}
-        extra_info.setdefault('form', self)
-
-        result = render(template, extra_info, self.request)
-        if htmlfill:
-            result = self.htmlfill(result, **htmlfill_kwargs)
-        return result
->>>>>>> other

File pyramid_simpleform/tests.py

         self.assert_(form.validate())
         self.assert_(form.is_validated)
  
-<<<<<<< local
-=======
-    def test_render_without_htmlfill(self):
-
-        from pyramid_simpleform import Form
-
-        request = testing.DummyRequest()
-        request.POST['name'] = 'test'
-        request.method = "POST"
-        
-        settings = {}
-
-        settings['mako.directories'] = 'pyramid_simpleform:templates'
-        config = Configurator(settings=settings)
-
-
-        config.add_renderer('.html', 
-                            'pyramid.mako_templating.renderer_factory')
-
-        request.registry = config.registry
-
-        form = Form(request, SimpleSchema)
-
-        result = form.render("test_form.html", htmlfill=False)
-        self.assert_('<input type="text" name="name" size="20">' 
-                     in result)
-
-
-    def test_render_with_htmlfill(self):
-
-        from pyramid_simpleform import Form
-
-        request = testing.DummyRequest()
-        request.POST['name'] = 'test'
-        request.method = "POST"
-        
-        settings = {}
-
-        settings['mako.directories'] = 'pyramid_simpleform:templates'
-        config = Configurator(settings=settings)
-
-
-        config.add_renderer('.html', 
-                            'pyramid.mako_templating.renderer_factory')
-
-        request.registry = config.registry
-
-        form = Form(request, SimpleSchema, defaults={'name' : 'foo'})
-
-        result = form.render("test_form.html", htmlfill=True)
-        self.assert_('<input type="text" name="name" size="20" value="foo">' 
-                     in result)
-
-
-    def test_htmlfill(self):
-        from pyramid_simpleform import Form
-
-        request = testing.DummyRequest()
-        form = Form(request, SimpleSchema, 
-                    defaults={"name" : "testing"})
-
-        html = """
-        <form method="POST" action=".">
-            <input type="text" name="name">
-        </form>
-        """
-
-        html = form.htmlfill(html)
-        self.assert_('value="testing"' in html)
-
->>>>>>> other
 
 class TestFormRenderer(unittest.TestCase):