Exemplo n.º 1
0
 def test_basic_config(self):
     """
     basic conf edition
     """
     form_data = {"site_name": "foo", "site_description": "bar"}
     form = BasicConfigForm(data=form_data)
     self.assertEqual(form.is_valid(), True)
Exemplo n.º 2
0
 def test_basic_config(self):
     """
     basic conf edition
     """
     form_data = {"site_name": "foo",
                  "site_description": "bar"}
     form = BasicConfigForm(data=form_data)
     self.assertEqual(form.is_valid(), True)
Exemplo n.º 3
0
def config_basic(request):

    if request.method == 'POST':
        form = BasicConfigForm(data=request.POST)

        if form.is_valid():
            form.save()
            messages.info(request, _("Settings updated!"))
            return redirect(request.GET.get("next", request.get_full_path()))
    else:
        form = BasicConfigForm()

    return render(request, 'spirit/admin/config/config_basic.html', {'form': form, })
Exemplo n.º 4
0
def config_basic(request):

    if request.method == 'POST':
        form = BasicConfigForm(data=request.POST)

        if form.is_valid():
            form.save()
            messages.info(request, _("Settings updated!"))
            return redirect(request.GET.get("next", request.get_full_path()))
    else:
        form = BasicConfigForm()

    return render(request, 'spirit/admin/config/config_basic.html', {'form': form, })
Exemplo n.º 5
0
    def test_basic_config(self):
        """
        basic conf edition
        """
        form_data = {"site_name": "foo",
                     "site_description": "",
                     "template_footer": "",
                     "comments_per_page": 10,
                     "topics_per_page": 10}
        form = BasicConfigForm(data=form_data)
        self.assertEqual(form.is_valid(), True)

        form_data = {"site_name": "foo",
                     "site_description": "bar",
                     "template_footer": "foobar",
                     "comments_per_page": 10,
                     "topics_per_page": 10}
        form = BasicConfigForm(data=form_data)
        self.assertEqual(form.is_valid(), True)