Little fixes in tests
This commit is contained in:
parent
b7920fa350
commit
0b2ecfc986
2 changed files with 21 additions and 1 deletions
|
|
@ -854,7 +854,14 @@ class WebModel:
|
|||
except:
|
||||
in_list[x]=str(0)
|
||||
return '('+', '.join(in_list)+')'
|
||||
|
||||
|
||||
def check_in_list_str(self, field, in_list):
|
||||
|
||||
for x in range(0, len(in_list)):
|
||||
in_list[x]=self.fields[field].check(in_list[x])
|
||||
|
||||
return '("'+'", "'.join(in_list)+'")'
|
||||
|
||||
def set_order(self, order:dict) -> object:
|
||||
|
||||
arr_order=[]
|
||||
|
|
|
|||
|
|
@ -265,6 +265,19 @@ class TestWebModelMethods(unittest.TestCase):
|
|||
connection.close()
|
||||
|
||||
pass
|
||||
|
||||
def test_check_filter_list_str(self):
|
||||
|
||||
print('Check string list filtering')
|
||||
|
||||
connection=WebModel.connection()
|
||||
model=ExampleModel(connection)
|
||||
|
||||
str_filter=model.check_in_list_str('title', ['joan', 'piter', 'luiz"'])
|
||||
|
||||
self.assertEqual(str_filter, '("joan", "piter", "luiz"")')
|
||||
|
||||
connection.close()
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue