• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hivesolutions / budy / 316

pending completion
316

push

travis-ci

joamag
support for checkout mode in store

2 of 2 new or added lines in 1 file covered. (100.0%)

1939 of 2467 relevant lines covered (78.6%)

12.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.12
/src/budy/models/store.py
1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
3

4
# Hive Budy
5
# Copyright (c) 2008-2016 Hive Solutions Lda.
6
#
7
# This file is part of Hive Budy.
8
#
9
# Hive Budy is free software: you can redistribute it and/or modify
10
# it under the terms of the Apache License as published by the Apache
11
# Foundation, either version 2.0 of the License, or (at your option) any
12
# later version.
13
#
14
# Hive Budy is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# Apache License for more details.
18
#
19
# You should have received a copy of the Apache License along with
20
# Hive Budy. If not, see <http://www.apache.org/licenses/>.
21

22
__author__ = "João Magalhães <joamag@hive.pt>"
16✔
23
""" The author(s) of the module """
24

25
__version__ = "1.0.0"
16✔
26
""" The version of the module """
27

28
__revision__ = "$LastChangedRevision$"
16✔
29
""" The revision number of the module """
30

31
__date__ = "$LastChangedDate$"
16✔
32
""" The last change date of the module """
33

34
__copyright__ = "Copyright (c) 2008-2016 Hive Solutions Lda."
16✔
35
""" The copyright for the module """
36

37
__license__ = "Apache License, Version 2.0"
16✔
38
""" The license for the module """
39

40
import appier
16✔
41

42
from . import base
16✔
43

44
class Store(base.BudyBase):
16✔
45

46
    name = appier.field(
16✔
47
        index = True,
48
        default = True
49
    )
50

51
    address = appier.field(
16✔
52
        type = appier.reference(
53
            "Address",
54
            name = "id"
55
        ),
56
        eager = True
57
    )
58

59
    currency_code = appier.field(
16✔
60
        index = True
61
    )
62

63
    checkout_mode = appier.field(
16✔
64
        index = True
65
    )
66

67
    @classmethod
16✔
68
    def validate(cls):
69
        return super(Store, cls).validate() + [
16✔
70
            appier.not_null("name"),
71
            appier.not_empty("name"),
72

73
            appier.string_eq("currency_code", 3)
74
        ]
75

76
    @classmethod
16✔
77
    def list_names(cls):
78
        return ["id", "name", "currency_code", "checkout_mode"]
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2024 Coveralls, Inc