Beispiel #1
0
 def test_create_sellorder(self):
     url = reverse('sales_sellorder_create')
     data = {
         "details": "details",
         "seller": create_seller().pk,
         "status": create_sellorderstatus().pk,
         "tracking": create_tracking().pk,
     }
     response = self.client.post(url, data=data)
     self.assertEqual(response.status_code, 302)
Beispiel #2
0
 def test_create_trackingcost(self):
     url = reverse('costs_trackingcost_create')
     data = {
         "slug": "slug",
         "payment": create_payment().pk,
         "ref": create_tracking().pk,
         "type": create_costtype().pk,
     }
     response = self.client.post(url, data=data)
     self.assertEqual(response.status_code, 302)
Beispiel #3
0
def create_trackingcost(**kwargs):
    defaults = {}
    defaults["slug"] = "slug"
    defaults.update(**kwargs)
    if "payment" not in defaults:
        defaults["payment"] = create_payment()
    if "ref" not in defaults:
        defaults["ref"] = create_tracking()
    if "type" not in defaults:
        defaults["type"] = create_costtype()
    return TrackingCost.objects.create(**defaults)
Beispiel #4
0
def create_sellorder(**kwargs):
    defaults = {}
    defaults["details"] = "details"
    defaults.update(**kwargs)
    if "seller" not in defaults:
        defaults["seller"] = create_seller()
    if "status" not in defaults:
        defaults["status"] = create_sellorderstatus()
    if "tracking" not in defaults:
        defaults["tracking"] = create_tracking()
    return SellOrder.objects.create(**defaults)
Beispiel #5
0
 def test_update_sellorder(self):
     sellorder = create_sellorder()
     data = {
         "details": "details",
         "seller": create_seller().pk,
         "status": create_sellorderstatus().pk,
         "tracking": create_tracking().pk,
     }
     url = reverse('sales_sellorder_update', args=[sellorder.slug, ])
     response = self.client.post(url, data)
     self.assertEqual(response.status_code, 302)
Beispiel #6
0
def create_purchaseorder(**kwargs):
    defaults = {}
    defaults["details"] = "details"
    defaults.update(**kwargs)
    if "supplier" not in defaults:
        defaults["supplier"] = create_supplier()
    if "status" not in defaults:
        defaults["status"] = create_purchaseorderstatus()
    if "tracking" not in defaults:
        defaults["tracking"] = create_tracking()
    return PurchaseOrder.objects.create(**defaults)
Beispiel #7
0
 def test_create_trackingpayment(self):
     url = reverse('payments_trackingpayment_create')
     data = {
         "slug": "slug",
         "date": timezone.now(),
         "amount": 100.00,
         "status": create_paymentstatus().pk,
         "method": create_paymentmethod().pk,
         "ref": create_tracking().pk,
     }
     response = self.client.post(url, data=data)
     self.assertEqual(response.status_code, 302)
Beispiel #8
0
def create_trackingpayment(**kwargs):
    defaults = {}
    defaults["slug"] = "slug"
    defaults["date"] = timezone.now()
    defaults["amount"] = 100.00
    defaults.update(**kwargs)
    if "status" not in defaults:
        defaults["status"] = create_paymentstatus()
    if "method" not in defaults:
        defaults["method"] = create_paymentmethod()
    if "ref" not in defaults:
        defaults["ref"] = create_tracking()
    return TrackingPayment.objects.create(**defaults)