# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
import pytest
from shoop.admin.module_registry import replace_modules
from shoop.admin.modules.taxes import TaxModule
from shoop.admin.modules.taxes.views import TaxClassEditView
from shoop_tests.admin.utils import admin_only_urls


@pytest.mark.django_db
def test_tax_edit_view_works_at_all(rf, admin_user):
    pytest.skip("it doesn't")
    request = rf.get("/")
    request.user = admin_user

    with replace_modules([TaxModule]):
        with admin_only_urls():
            view_func = TaxClassEditView.as_view()
            response = view_func(request, pk=default_tax.pk)
            assert (default_tax.name in response.rendered_content)  # it's probable the name is there
            response = view_func(request, pk=None)  # "new mode"
            assert response.rendered_content  # yeah, something gets rendered

@@ -213,16 +213,61 @@
 e tree.%0A
+from django.utils.encoding import force_text%0A
 import p
@@ -272,16 +272,17 @@
  pytest%0A
+%0A
 from sho
@@ -452,172 +452,349 @@
 hoop
-_tests.admin.utils import admin_only_urls%0A%0A%0A@pytest.mark.django_db%0Adef test_tax_edit_view_works_at_all(rf, admin_user):%0A    pytest.skip(%22it doesn't%22)%0A    request = 
+.testing.factories import get_default_shop, get_default_tax_class%0Afrom shoop_tests.admin.utils import admin_only_urls%0Afrom shoop_tests.utils import apply_request_middleware%0A%0A%0A@pytest.mark.django_db%0Adef test_tax_edit_view_works_at_all(rf, admin_user):%0A    get_default_shop()  # We need a shop to exists%0A    request = apply_request_middleware(
 rf.g
@@ -800,16 +800,17 @@
 get(%22/%22)
+)
 %0A    req
@@ -833,16 +833,65 @@
 n_user%0A%0A
+    default_tax_class = get_default_tax_class()%0A%0A
     with
@@ -1064,13 +1064,49 @@
 _tax
+_class
 .pk)%0A
+            response.render()%0A
     
@@ -1132,16 +1132,22 @@
 ault_tax
+_class
 .name in
@@ -1151,69 +1151,37 @@
  in 
-response.rendered_content)  # it's probable the name is there
+force_text(response.content))
 %0A   
@@ -1254,23 +1254,16 @@
         
-assert 
 response
@@ -1273,48 +1273,43 @@
 nder
-ed_content  # yeah, something gets rendered
+()%0A            assert response.content
 %0A

Fix test_tax_module test