summarylogtreecommitdiffstats
path: root/PR34.patch
blob: 53f1ff537280449f02ae4c62834d5a3795811031 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
From 36348bf4c01f52c3461e7ba4d20b1edfc54dba50 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mark=C3=A9ta=20Cal=C3=A1bkov=C3=A1?=
 <meggy.calabkova@gmail.com>
Date: Tue, 3 Aug 2021 12:48:30 +0200
Subject: [PATCH 1/3] compatibility with pyramid 2

---
 pyramid_chameleon/tests/test_text.py | 7 +++----
 pyramid_chameleon/tests/test_zpt.py  | 5 ++---
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/pyramid_chameleon/tests/test_text.py b/pyramid_chameleon/tests/test_text.py
index ca294ca..37801a5 100644
--- a/pyramid_chameleon/tests/test_text.py
+++ b/pyramid_chameleon/tests/test_text.py
@@ -1,7 +1,6 @@
 import sys
 import unittest
 
-from pyramid.compat import binary_type
 from pyramid import testing
 
 class Base(object):
@@ -97,7 +96,7 @@ def test_call(self):
         lookup = DummyLookup()
         instance = self._makeOne(minimal, lookup)
         result = instance({}, {})
-        self.assertTrue(isinstance(result, binary_type))
+        self.assertTrue(isinstance(result, bytes))
         self.assertEqual(result, b'Hello.\n')
 
     def test_call_with_nondict_value(self):
@@ -111,7 +110,7 @@ def test_call_nonminimal(self):
         lookup = DummyLookup()
         instance = self._makeOne(nonminimal, lookup)
         result = instance({'name':'Chris'}, {})
-        self.assertTrue(isinstance(result, binary_type))
+        self.assertTrue(isinstance(result, bytes))
         self.assertEqual(result, b'Hello, Chris!\n')
 
     def test_implementation(self):
@@ -119,7 +118,7 @@ def test_implementation(self):
         lookup = DummyLookup()
         instance = self._makeOne(minimal, lookup)
         result = instance.implementation()()
-        self.assertTrue(isinstance(result, binary_type))
+        self.assertTrue(isinstance(result, bytes))
         self.assertEqual(result, b'Hello.\n')
 
 class DummyLookup(object):
diff --git a/pyramid_chameleon/tests/test_zpt.py b/pyramid_chameleon/tests/test_zpt.py
index 9678904..2db2206 100644
--- a/pyramid_chameleon/tests/test_zpt.py
+++ b/pyramid_chameleon/tests/test_zpt.py
@@ -2,7 +2,6 @@
 import unittest
 
 from pyramid import testing
-from pyramid.compat import text_type
 
 class Base(object):
     def setUp(self):
@@ -54,7 +53,7 @@ def test_call(self):
         lookup = DummyLookup()
         instance = self._makeOne(minimal, lookup)
         result = instance({}, {})
-        self.assertTrue(isinstance(result, text_type))
+        self.assertTrue(isinstance(result, str))
         self.assertEqual(result.rstrip('\n'),
                      '<div xmlns="http://www.w3.org/1999/xhtml">\n</div>')
 
@@ -121,7 +120,7 @@ def test_implementation(self):
         lookup = DummyLookup()
         instance = self._makeOne(minimal, lookup)
         result = instance.implementation()()
-        self.assertTrue(isinstance(result, text_type))
+        self.assertTrue(isinstance(result, str))
         self.assertEqual(result.rstrip('\n'),
                      '<div xmlns="http://www.w3.org/1999/xhtml">\n</div>')