fix: format all code with black

and from now on should not deviate from that...
This commit is contained in:
Lance Edgar 2025-08-31 12:59:28 -05:00
parent 925235f0d3
commit 2107e9ee1d
47 changed files with 5729 additions and 3977 deletions

View file

@ -17,10 +17,10 @@ class TestOrderRef(WebTestCase):
self.assertIsNot(sorted_query, query)
def test_get_object_url(self):
self.pyramid_config.add_route('orders.view', '/orders/{uuid}')
self.pyramid_config.add_route("orders.view", "/orders/{uuid}")
model = self.app.model
user = model.User(username='barney')
user = model.User(username="barney")
self.session.add(user)
order = model.Order(order_id=42, created_by=user)
self.session.add(order)
@ -29,7 +29,7 @@ class TestOrderRef(WebTestCase):
typ = mod.OrderRef(self.request, session=self.session)
url = typ.get_object_url(order)
self.assertIsNotNone(url)
self.assertIn(f'/orders/{order.uuid}', url)
self.assertIn(f"/orders/{order.uuid}", url)
class TestLocalCustomerRef(WebTestCase):
@ -43,7 +43,7 @@ class TestLocalCustomerRef(WebTestCase):
self.assertIsNot(sorted_query, query)
def test_get_object_url(self):
self.pyramid_config.add_route('local_customers.view', '/local/customers/{uuid}')
self.pyramid_config.add_route("local_customers.view", "/local/customers/{uuid}")
model = self.app.model
enum = self.app.enum
@ -54,7 +54,7 @@ class TestLocalCustomerRef(WebTestCase):
typ = mod.LocalCustomerRef(self.request, session=self.session)
url = typ.get_object_url(customer)
self.assertIsNotNone(url)
self.assertIn(f'/local/customers/{customer.uuid}', url)
self.assertIn(f"/local/customers/{customer.uuid}", url)
class TestPendingCustomerRef(WebTestCase):
@ -68,21 +68,24 @@ class TestPendingCustomerRef(WebTestCase):
self.assertIsNot(sorted_query, query)
def test_get_object_url(self):
self.pyramid_config.add_route('pending_customers.view', '/pending/customers/{uuid}')
self.pyramid_config.add_route(
"pending_customers.view", "/pending/customers/{uuid}"
)
model = self.app.model
enum = self.app.enum
user = model.User(username='barney')
user = model.User(username="barney")
self.session.add(user)
customer = model.PendingCustomer(status=enum.PendingCustomerStatus.PENDING,
created_by=user)
customer = model.PendingCustomer(
status=enum.PendingCustomerStatus.PENDING, created_by=user
)
self.session.add(customer)
self.session.commit()
typ = mod.PendingCustomerRef(self.request, session=self.session)
url = typ.get_object_url(customer)
self.assertIsNotNone(url)
self.assertIn(f'/pending/customers/{customer.uuid}', url)
self.assertIn(f"/pending/customers/{customer.uuid}", url)
class TestLocalProductRef(WebTestCase):
@ -96,7 +99,7 @@ class TestLocalProductRef(WebTestCase):
self.assertIsNot(sorted_query, query)
def test_get_object_url(self):
self.pyramid_config.add_route('local_products.view', '/local/products/{uuid}')
self.pyramid_config.add_route("local_products.view", "/local/products/{uuid}")
model = self.app.model
enum = self.app.enum
@ -107,7 +110,7 @@ class TestLocalProductRef(WebTestCase):
typ = mod.LocalProductRef(self.request, session=self.session)
url = typ.get_object_url(product)
self.assertIsNotNone(url)
self.assertIn(f'/local/products/{product.uuid}', url)
self.assertIn(f"/local/products/{product.uuid}", url)
class TestPendingProductRef(WebTestCase):
@ -121,18 +124,21 @@ class TestPendingProductRef(WebTestCase):
self.assertIsNot(sorted_query, query)
def test_get_object_url(self):
self.pyramid_config.add_route('pending_products.view', '/pending/products/{uuid}')
self.pyramid_config.add_route(
"pending_products.view", "/pending/products/{uuid}"
)
model = self.app.model
enum = self.app.enum
user = model.User(username='barney')
user = model.User(username="barney")
self.session.add(user)
product = model.PendingProduct(status=enum.PendingProductStatus.PENDING,
created_by=user)
product = model.PendingProduct(
status=enum.PendingProductStatus.PENDING, created_by=user
)
self.session.add(product)
self.session.commit()
typ = mod.PendingProductRef(self.request, session=self.session)
url = typ.get_object_url(product)
self.assertIsNotNone(url)
self.assertIn(f'/pending/products/{product.uuid}', url)
self.assertIn(f"/pending/products/{product.uuid}", url)