Browse Source

[MIG] To 11.0

pull/1465/head
Enric Tobella 6 years ago
parent
commit
98e43d9b0b
  1. 1
      .travis.yml
  2. 2
      profiler/__manifest__.py
  3. 36
      profiler/tests/test_profiling.py

1
.travis.yml

@ -12,6 +12,7 @@ addons:
packages:
- expect-dev # provides unbuffer utility
- python-lxml # because pip installation is slow
- pgbadger
- nsca-client
env:

2
profiler/__manifest__.py

@ -3,7 +3,7 @@
'author': "Vauxoo, Odoo Community Association (OCA)",
'website': "https://github.com/OCA/server-tools/tree/12.0/profiler",
'category': 'Tests',
'version': '12.0.1.0.0',
'version': '11.0.1.0.0',
'license': 'AGPL-3',
'depends': ["document"],
'data': [

36
profiler/tests/test_profiling.py

@ -1,13 +1,45 @@
# Copyright 2018 Vauxoo (https://www.vauxoo.com) <info@vauxoo.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp.tests.common import TransactionCase
from odoo.tests.common import HttpCase
class TestProfiling(TransactionCase):
class TestProfiling(HttpCase):
def test_profile_creation(self):
"""We are testing the creation of a profile."""
prof_obj = self.env['profiler.profile']
profile = prof_obj.create({'name': 'this_profiler'})
self.assertEqual(0, profile.attachment_count)
profile.enable()
self.assertFalse(self.xmlrpc_common.authenticate(
self.env.cr.dbname, 'this is not a user',
'this is not a password', {}))
profile.disable()
def test_profile_creation_with_py(self):
"""We are testing the creation of a profile. with py index"""
prof_obj = self.env['profiler.profile']
profile = prof_obj.create({
'name': 'this_profiler',
'use_py_index': True,
})
self.assertEqual(0, profile.attachment_count)
profile.enable()
self.assertFalse(self.xmlrpc_common.authenticate(
self.env.cr.dbname, 'this is not a user',
'this is not a password', {}))
profile.disable()
def test_onchange(self):
prof_obj = self.env['profiler.profile']
profile = prof_obj.create({'name': 'this_profiler'})
self.assertFalse(profile.description)
profile.enable_postgresql = True
profile.onchange_enable_postgresql()
self.assertTrue(profile.description)
profile.enable()
self.assertFalse(self.xmlrpc_common.authenticate(
self.env.cr.dbname, 'this is not a user',
'this is not a password', {}))
profile.disable()
Loading…
Cancel
Save