Source code for cannabis_reports.tests.test_apis_producer
# -*- coding: utf-8 -*-
# Copyright 2017-TODAY LasLabs Inc.
# License MIT (https://opensource.org/licenses/MIT).
from .api_common import recorder
from .api_entity import ApiEntityAbstract
from ..models.producer import Producer
[docs]class TestApisProducers(ApiEntityAbstract):
"""Tests the Producers API endpoint."""
UID = '0000000000L6M7E0000000000'
[docs] def setUp(self):
super(TestApisProducers, self).setUp()
self.endpoint = self.api.Producers
[docs] @recorder.use_cassette()
def test_apis_producers_list(self):
"""It should parse the response and return the proper object."""
self._test_apis_objects_list(Producer)
[docs] @recorder.use_cassette()
def test_apis_producers_get(self):
"""It should return the proper singleton."""
self._test_apis_objects_get('Kiva')
[docs] @recorder.use_cassette()
def test_apis_producers_get_edibles(self):
"""It should return the edibles for a producer."""
self._test_apis_objects_get_edibles()
[docs] @recorder.use_cassette()
def test_apis_producers_get_products(self):
"""It should return the products for a producer."""
self.UID = '0000000000N4E9N0000000000'
self._test_apis_objects_get_products()
[docs] @recorder.use_cassette()
def test_apis_producers_get_available(self):
"""It should return the availables for a producer."""
self._test_apis_objects_get_available()