Commit 8414795b authored by Łukasz Nowak's avatar Łukasz Nowak

Check result in postInformation method.

parent 107a3ebf
...@@ -62,7 +62,8 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase): ...@@ -62,7 +62,8 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
data = result.read() data = result.read()
finally: finally:
connection.close() connection.close()
return result.status, data self.assertEqual(result.status, httplib.CREATED)
self.assertEqual(data, '')
def getInformation(self, key=None): def getInformation(self, key=None):
""" """
...@@ -96,11 +97,7 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase): ...@@ -96,11 +97,7 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
""" """
Check if posting information is working. Check if posting information is working.
""" """
result, data = self.postInformation() self.postInformation()
self.assertEqual(result, httplib.CREATED)
self.assertEqual(data, '')
transaction.commit() transaction.commit()
self.tic() self.tic()
...@@ -143,17 +140,11 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase): ...@@ -143,17 +140,11 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
""" """
Check if posting information is working. Check if posting information is working.
""" """
result, data = self.postInformation() self.postInformation()
self.assertEqual(result, httplib.CREATED)
self.assertEqual(data, '')
transaction.commit() transaction.commit()
self.tic() self.tic()
result, data = self.postInformation() self.postInformation()
self.assertEqual(result, httplib.CREATED)
self.assertEqual(data, '')
transaction.commit() transaction.commit()
self.tic() self.tic()
...@@ -176,9 +167,9 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase): ...@@ -176,9 +167,9 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
check if return the temp document with text content. check if return the temp document with text content.
""" """
self.postInformation() self.postInformation()
transaction.commit() transaction.commit()
self.tic() self.tic()
result, data = self.getInformation() result, data = self.getInformation()
self.assertEqual(result, httplib.OK) self.assertEqual(result, httplib.OK)
information_list = json.loads(data) information_list = json.loads(data)
...@@ -197,7 +188,6 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase): ...@@ -197,7 +188,6 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
This relation is controlled by Data Set object. This relation is controlled by Data Set object.
""" """
self.postInformation() self.postInformation()
transaction.commit() transaction.commit()
self.tic() self.tic()
...@@ -213,9 +203,7 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase): ...@@ -213,9 +203,7 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
'architecture': self.architecture}, 'architecture': self.architecture},
"User SIGNATURE goes here."] "User SIGNATURE goes here."]
data_2 = json.dumps(data_list_2) data_2 = json.dumps(data_list_2)
result, data = self.postInformation(key_2, data_2) self.postInformation(key_2, data_2)
self.assertEqual(result, httplib.CREATED)
transaction.commit() transaction.commit()
self.tic() self.tic()
...@@ -228,9 +216,7 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase): ...@@ -228,9 +216,7 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
result, document2 = self.getInformation(key_2) result, document2 = self.getInformation(key_2)
self.assertEquals(1, len(json.loads(document2))) self.assertEquals(1, len(json.loads(document2)))
result, data = self.postInformation() self.postInformation()
self.assertEqual(result, httplib.CREATED)
transaction.commit() transaction.commit()
self.tic() self.tic()
self.assertEquals(2, len(self.portal.data_set_module)) self.assertEquals(2, len(self.portal.data_set_module))
......
62 63
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment