You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.6 KiB

7 years ago
7 years ago
7 years ago
7 years ago
  1. ###################################################################################
  2. #
  3. # MuK Document Management System
  4. #
  5. # Copyright (C) 2018 MuK IT GmbH
  6. #
  7. # This program is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU Affero General Public License as
  9. # published by the Free Software Foundation, either version 3 of the
  10. # License, or (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU Affero General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Affero General Public License
  18. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. #
  20. ###################################################################################
  21. import os
  22. import json
  23. import base64
  24. import logging
  25. import unittest
  26. import requests
  27. import odoo
  28. from odoo import _
  29. from odoo.tests import common
  30. _logger = logging.getLogger(__name__)
  31. class AttachmentTestCase(common.TransactionCase):
  32. at_install = False
  33. post_install = True
  34. def setUp(self):
  35. super(AttachmentTestCase, self).setUp()
  36. self.attachment = self.env['ir.attachment'].sudo()
  37. def tearDown(self):
  38. super(AttachmentTestCase, self).tearDown()
  39. def test_groupy(self):
  40. result = self.attachment.read_group(
  41. domain=[],
  42. fields=['name', 'create_date'],
  43. groupby='create_date:hour')
  44. self.assertTrue(result)