File: common.py

package info (click to toggle)
oca-core 11.0.20180730-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 509,684 kB
  • sloc: xml: 258,806; python: 164,081; sql: 217; sh: 92; makefile: 16
file content (51 lines) | stat: -rw-r--r-- 2,165 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# -*- coding: utf-8 -*-

from odoo.tests import common


class PaymentAcquirerCommon(common.TransactionCase):

    def setUp(self):
        super(PaymentAcquirerCommon, self).setUp()

        self.currency_euro = self.env['res.currency'].search([('name', '=', 'EUR')], limit=1)
        self.country_belgium = self.env['res.country'].search([('code', 'like', 'BE')], limit=1)
        self.country_france = self.env['res.country'].search([('code', 'like', 'FR')], limit=1)

        # dict partner values
        self.buyer_values = {
            'partner_name': 'Norbert Buyer',
            'partner_lang': 'en_US',
            'partner_email': 'norbert.buyer@example.com',
            'partner_address': 'Huge Street 2/543',
            'partner_phone': '0032 12 34 56 78',
            'partner_city': 'Sin City',
            'partner_zip': '1000',
            'partner_country': self.env['res.country'].browse(self.country_belgium.id),
            'partner_country_id': self.country_belgium.id,
            'partner_country_name': 'Belgium',
            'billing_partner_name': 'Norbert Buyer',
            'billing_partner_commercial_company_name': 'Big Company',
            'billing_partner_lang': 'en_US',
            'billing_partner_email': 'norbert.buyer@example.com',
            'billing_partner_address': 'Huge Street 2/543',
            'billing_partner_phone': '0032 12 34 56 78',
            'billing_partner_city': 'Sin City',
            'billing_partner_zip': '1000',
            'billing_partner_country': self.env['res.country'].browse(self.country_belgium.id),
            'billing_partner_country_id': self.country_belgium.id,
            'billing_partner_country_name': 'Belgium',
        }

        # test partner
        self.buyer = self.env['res.partner'].create({
            'name': 'Norbert Buyer',
            'lang': 'en_US',
            'email': 'norbert.buyer@example.com',
            'street': 'Huge Street',
            'street2': '2/543',
            'phone': '0032 12 34 56 78',
            'city': 'Sin City',
            'zip': '1000',
            'country_id': self.country_belgium.id})
        self.buyer_id = self.buyer.id