window.addEventListener('name-updated', event => {
alert('Name updated to: ' + event.detail.newName);
})
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from httpx import Response, Client | |
from app import app | |
from factories import UserFactory, BasketFactory | |
from unittest.mock import MagicMock | |
class QuickMock: | |
def __init__(self, object_: object, prop: str, value: Any) -> None: | |
self.__object = object_ | |
self.__prop = prop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from httpx import Response, Client | |
from app import app | |
from factories import UserFactory, BasketFactory | |
from unittest.mock import MagicMock | |
def test_purchase_basket_controller(): | |
get_gateway_url = payment_sdk.get_gateway_url | |
payment_sdk.get_gateway_url = MagicMock(return_value='https://sample_bank_url.test') | |
with Client(app=app, base_url="http://testserver.test", timeout=0.1) as client: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from httpx import Response, Client | |
from app import app | |
from factories import UserFactory, BasketFactory | |
from unittest.mock import MagicMock | |
def test_purchase_basket_controller(): | |
payment_sdk.get_gateway_url = MagicMock(return_value='https://sample_bank_url.test') | |
with Client(app=app, base_url="http://testserver.test", timeout=0.1) as client: | |
user = UserFactory.create_one() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from httpx import Response, Client | |
from app import app | |
from factories import UserFactory, BasketFactory | |
def test_purchase_basket_controller(): | |
with Client(app=app, base_url="http://testserver.test", timeout=0.1) as client: | |
user = UserFactory.create_one() | |
basket = BasketFactory.create_one(user_id=user.id) | |
response = client.post( | |
url='/basket/purchase', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from starlette.responses import RedirectResponse | |
from payment_sdk import payment_sdk | |
from basket import Basket | |
class PurchaseBasketController: | |
def __init__(self,basket : Basket): | |
self.__basket = basket | |
def __validate(self): | |
pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Orchid\Layouts\Course; | |
use App\Services\Screen\Fields\TinyMCE; | |
use Orchid\Screen\Field; | |
use Orchid\Screen\Layouts\Rows; | |
class CourseEditContentLayout extends Rows | |
{ |