Giter Site home page Giter Site logo

Testing about django-ninja HOT 2 CLOSED

vitalik avatar vitalik commented on May 6, 2024
Testing

from django-ninja.

Comments (2)

fletcheaston avatar fletcheaston commented on May 6, 2024 1

I'm more inclined towards using the internal client, so I can avoid dealing with middle layers like you mentioned. I'll just copy that for my own local use for now, maybe it's worth including in the main package? But unless this is something others would want, I think it's fine to leave it out for now.

Thanks!

from django-ninja.

vitalik avatar vitalik commented on May 6, 2024

@fletcheaston

that's a good question...
Basically there are 2 ways:

  1. once ninja api included to urls - you can use standard django TestClient against it

  2. internally (to speedup tests) I also use custom test client that operates NinjaAPI instance directly (without django layer of middlewares and url resolvers) see - https://github.com/vitalik/django-ninja/blob/master/tests/client.py

I will think about it - maybe it makes sense also to add test client to main package...

from django-ninja.

Related Issues (20)

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.