|
@@ -4,6 +4,7 @@ import pytest
|
|
|
|
|
|
import datetime
|
|
|
import dingguo
|
|
|
+import ioex.datetimeex
|
|
|
import os
|
|
|
import pprint
|
|
|
import pytz
|
|
@@ -14,12 +15,27 @@ def get_item_a():
|
|
|
name = u'item',
|
|
|
price_brutto = dingguo.Sum(1.0, u'EUR'),
|
|
|
)
|
|
|
+
|
|
|
def get_item_b():
|
|
|
return dingguo.Item(
|
|
|
name = u'item',
|
|
|
price_brutto = dingguo.Sum(2.0, u'EUR'),
|
|
|
)
|
|
|
|
|
|
+def get_service_a():
|
|
|
+ return dingguo.Service(
|
|
|
+ name = u'service',
|
|
|
+ price_brutto = dingguo.Sum(1.0, u'EUR'),
|
|
|
+ duration = ioex.datetimeex.Duration(years = 2),
|
|
|
+ )
|
|
|
+
|
|
|
+def get_service_b():
|
|
|
+ return dingguo.Service(
|
|
|
+ name = u'service',
|
|
|
+ price_brutto = dingguo.Sum(1.0, u'EUR'),
|
|
|
+ duration = ioex.datetimeex.Duration(),
|
|
|
+ )
|
|
|
+
|
|
|
def get_discount_a():
|
|
|
return dingguo.Discount(
|
|
|
name = u'discount',
|
|
@@ -144,6 +160,8 @@ def get_shipping():
|
|
|
[get_person_b(), get_person_b()],
|
|
|
[get_pledge_a(), get_pledge_a()],
|
|
|
[get_pledge_b(), get_pledge_b()],
|
|
|
+ [get_service_a(), get_service_a()],
|
|
|
+ [get_service_b(), get_service_b()],
|
|
|
[get_shipping(), get_shipping()],
|
|
|
])
|
|
|
def test_eq(a, b):
|
|
@@ -162,6 +180,7 @@ def test_eq(a, b):
|
|
|
[get_contribution_a(), get_contribution_b()],
|
|
|
[get_contribution_a(), get_item_b()],
|
|
|
[get_discount_a(), get_discount_b()],
|
|
|
+ [get_discount_a(), get_item_b()],
|
|
|
[get_item_a(), get_item_b()],
|
|
|
[get_order_a(), get_order_a(items = False)],
|
|
|
[get_order_a(), get_order_b()],
|
|
@@ -171,6 +190,7 @@ def test_eq(a, b):
|
|
|
[get_pledge_a(), get_contribution_b()],
|
|
|
[get_pledge_a(), get_item_b()],
|
|
|
[get_pledge_a(), get_pledge_b()],
|
|
|
+ [get_service_a(), get_service_b()],
|
|
|
])
|
|
|
def test_neq(a, b):
|
|
|
assert a != b
|