GithubHelp home page GithubHelp logo

ori-roza / drf-api-action Goto Github PK

View Code? Open in Web Editor NEW
95.0 95.0 4.0 1.3 MB

drf-api-action elevates Django Rest Framework testing with the action_api fixture, simplifying REST endpoint testing to a seamless, function-like experience.

Python 100.00%
api backend decorators django django-rest-framework django-test django-testing pytest pytest-fixtures python testing unit-testing webdevelopment

drf-api-action's People

Contributors

actions-user avatar dependabot[bot] avatar ori-roza avatar oriroza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

drf-api-action's Issues

Request to Add Python 3.12 Support to drf-api-action Project

The current version of the drf-api-action project lacks support for Python 3.12. With the upcoming release of Python 3.12, it is essential to ensure compatibility with the latest Python version. This issue is raised to request the addition of Python 3.12 support to the project.

Update README:

  • Add a badge indicating support for Python 3.12 in the README file.

Update CI Configuration:

  • Add Python 3.12 to the version matrix in the project's CI configuration file (e.g., .travis.yml, .github/workflows/main.yml).

Test Compatibility:

  • Implement necessary changes to ensure that the project functions as expected with Python 3.12.
    Documentation Updates:

If any specific considerations or changes are needed for Python 3.12 compatibility, document them in the project's documentation.

Expected Behavior
After the proposed changes are implemented, the project should be compatible with Python 3.12, and the CI builds should pass successfully.

Steps to Reproduce
Update the README with the Python 3.12 badge.
Add Python 3.12 to the version matrix in the CI configuration file.
Test the project with Python 3.12 to ensure compatibility.
Additional Information

Link to the Python 3.12 release notes for reference.
If there are any specific features or changes in Python 3.12 that the project should leverage or address, please mention them here.
This enhancement will help users and contributors of the drf-api-action project to stay up-to-date with the latest Python version and benefit from any improvements or features introduced in Python 3.12.

Add auto pypi deployment

Add auto Pypi deployment

Description

  • Add .yaml file to github actions that auto deploys a new version to pypi
  • Create a secret on Github of twine user

Create a fixture that using drf-api-action capabilities

Instead of adding more features to the existing ViewSet, create a fixture that uses the same logic and turns ViewSet into regular callable functions.

Desired output:

class DummyViewSetFixture(ModelViewSet):
    queryset = DummyModel.objects.all()
    serializer_class = DummySerializer

    @action(detail=True, methods=["get"], serializer_class=DummySerializer)
    def api_dummy(self, request, **kwargs):
        serializer = self.get_serializer(instance=self.get_object())
        return Response(data=serializer.data, status=status.HTTP_200_OK)

...

import pytest
from tests.test_app.models import DummyModel
from tests.test_app.views import DummyViewSetFixture
from drf_api_action.fixtures import action_api


@pytest.mark.action_api(view_set_class=DummyViewSetFixture)
def test_call_as_api_fixture(db, action_api):
    dummy_model = DummyModel()
    dummy_model.dummy_int = 1
    dummy_model.save()
    res = action_api.api_dummy(pk=1)
    assert res["dummy_int"] == 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.