@@ -93,69 +93,69 @@ def test_cleanVocabularyCacheFor(self):
93
93
# once get, it is cached
94
94
vocab (self .portal )
95
95
self .assertTrue (getattr (vocab , memPropName ))
96
- self .assertEquals ([term .token for term in vocab (self .portal )._terms ],
96
+ self .assertEqual ([term .token for term in vocab (self .portal )._terms ],
97
97
['1' , '2' ])
98
98
99
99
# change value but do not clean cache
100
100
self .request .set ('vocab_values' , ('1' , '2' , '3' ))
101
- self .assertEquals ([term .token for term in vocab (self .portal )._terms ],
101
+ self .assertEqual ([term .token for term in vocab (self .portal )._terms ],
102
102
['1' , '2' ])
103
103
# clean vocabulary cache
104
104
cleanVocabularyCacheFor ("imio.helpers.testing.testingvocabulary" )
105
- self .assertEquals ([term .token for term in vocab (self .portal )._terms ],
105
+ self .assertEqual ([term .token for term in vocab (self .portal )._terms ],
106
106
['1' , '2' , '3' ])
107
107
108
108
# every existing vocabularies can also be cleaned if nothing passed to cleanVocabularyCacheFor
109
109
self .request .set ('vocab_values' , ('1' , '2' , '3' , '4' ))
110
- self .assertEquals ([term .token for term in vocab (self .portal )._terms ],
110
+ self .assertEqual ([term .token for term in vocab (self .portal )._terms ],
111
111
['1' , '2' , '3' ])
112
112
# clean vocabulary cache
113
113
cleanVocabularyCacheFor ("imio.helpers.testing.testingvocabulary" )
114
- self .assertEquals ([term .token for term in vocab (self .portal )._terms ],
114
+ self .assertEqual ([term .token for term in vocab (self .portal )._terms ],
115
115
['1' , '2' , '3' , '4' ])
116
116
117
117
# if cleanVocabularyCacheFor is called without parameter,
118
118
# every registered vocabularies cache is cleaned
119
119
self .request .set ('vocab_values' , ('1' , '2' , '3' , '4' , '5' ))
120
- self .assertEquals ([term .token for term in vocab (self .portal )._terms ],
120
+ self .assertEqual ([term .token for term in vocab (self .portal )._terms ],
121
121
['1' , '2' , '3' , '4' ])
122
122
cleanVocabularyCacheFor ()
123
- self .assertEquals ([term .token for term in vocab (self .portal )._terms ],
123
+ self .assertEqual ([term .token for term in vocab (self .portal )._terms ],
124
124
['1' , '2' , '3' , '4' , '5' ])
125
125
126
126
def test_cleanRamCache (self ):
127
127
"""
128
128
This helper method invalidates all ram.cache.
129
129
"""
130
130
self .request .set ('ramcached' , 'a' )
131
- self .assertEquals (ramCachedMethod (self .portal , param = '1' ), 'a' )
131
+ self .assertEqual (ramCachedMethod (self .portal , param = '1' ), 'a' )
132
132
# change value in REQUEST, as it is ram cached, it will still return 'a'
133
133
self .request .set ('ramcached' , 'b' )
134
- self .assertEquals (ramCachedMethod (self .portal , param = '1' ), 'a' )
134
+ self .assertEqual (ramCachedMethod (self .portal , param = '1' ), 'a' )
135
135
# ram.cache works as expected if param changes
136
- self .assertEquals (ramCachedMethod (self .portal , param = '2' ), 'b' )
136
+ self .assertEqual (ramCachedMethod (self .portal , param = '2' ), 'b' )
137
137
# try again
138
- self .assertEquals (ramCachedMethod (self .portal , param = '1' ), 'a' )
138
+ self .assertEqual (ramCachedMethod (self .portal , param = '1' ), 'a' )
139
139
# now clean all caches, it will returns 'b'
140
140
cleanRamCache ()
141
- self .assertEquals (ramCachedMethod (self .portal , param = '1' ), 'b' )
141
+ self .assertEqual (ramCachedMethod (self .portal , param = '1' ), 'b' )
142
142
143
143
def test_cleanRamCacheFor (self ):
144
144
"""
145
145
This helper method invalidates ram.cache for given method.
146
146
"""
147
147
self .request .set ('ramcached' , 'a' )
148
- self .assertEquals (ramCachedMethod (self .portal , param = '1' ), 'a' )
148
+ self .assertEqual (ramCachedMethod (self .portal , param = '1' ), 'a' )
149
149
# change value in REQUEST, as it is ram cached, it will still return 'a'
150
150
self .request .set ('ramcached' , 'b' )
151
- self .assertEquals (ramCachedMethod (self .portal , param = '1' ), 'a' )
151
+ self .assertEqual (ramCachedMethod (self .portal , param = '1' ), 'a' )
152
152
# ram.cache works as expected if param changes
153
- self .assertEquals (ramCachedMethod (self .portal , param = '2' ), 'b' )
153
+ self .assertEqual (ramCachedMethod (self .portal , param = '2' ), 'b' )
154
154
# try again
155
- self .assertEquals (ramCachedMethod (self .portal , param = '1' ), 'a' )
155
+ self .assertEqual (ramCachedMethod (self .portal , param = '1' ), 'a' )
156
156
# now clean cache, it will returns 'b'
157
157
cleanRamCacheFor ('imio.helpers.tests.test_cache.ramCachedMethod' )
158
- self .assertEquals (ramCachedMethod (self .portal , param = '1' ), 'b' )
158
+ self .assertEqual (ramCachedMethod (self .portal , param = '1' ), 'b' )
159
159
160
160
def test_cleanForeverCache (self ):
161
161
"""Test the cache.cleanForeverCache function."""
@@ -179,7 +179,7 @@ def test_get_cachekey_volatile(self):
179
179
volatiles = getattr (self .portal , VOLATILE_ATTR , {})
180
180
self .assertTrue (isinstance (volatiles .get (volatile_name ), datetime ))
181
181
# calling it again will still return same date
182
- self .assertEquals (date , get_cachekey_volatile (method_name ))
182
+ self .assertEqual (date , get_cachekey_volatile (method_name ))
183
183
# volatiles are not removed by tearDown, remove it now to avoid
184
184
# test isolation issues with test test_invalidate_cachekey_volatile_for
185
185
invalidate_cachekey_volatile_for (method_name )
0 commit comments