Code Monkey home page Code Monkey logo

drft's Introduction

DRFT

Django REST Framework Toolkit (DRFT)

Code style: black codecov Build

Installation

pip install drft

Local Development

Pyenv

It's recommended that you use pyenv, which you can read about more here.

pyenv-installer

curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash

Install Poetry

This project uses poetry, which you can read more about here. Install it using the following command.

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -

More instructions here

Installing dependencies

poetry install

Install pre-commit hooks:

poetry run pre-commit install --hook-type commit-msg
poetry run pre-commit install

Running Tests

For running tests this project uses both pytest and tox.

tox

Adding Tests

All tests are housed in the tests package. Two markers are made available to explicitly distinguish between unit and integration tests.

# in test_some_util.py
import pytest


@pytest.mark.unit
class TestSomeUtil:
    def test_basic_signature(self):
        ...


@pytest.mark.integration
class TestSomeUtilInApp:
    def test_app_workflow(self):
        ...

More information on pytest's markers can be found here.

To run just the unit tests:

pytest -m unit

To run everything but the unit tests:

pytest -m "not unit"

drft's People

Contributors

anthonyalmarza avatar

Watchers

 avatar  avatar

drft's Issues

Add tests for contrib.postgres.filters

Add tests to cover the features available in the postgres contrib filters.

  • Add dummy django app with searchable text fields
  • Mark tests as integration / regression tests
  • Unit test where reasonable

source
tests

Ensure GH Actions consistency with tox setup

  • Setup GH job strategy to test multiple versions of python vs multiple versions on Django/DRF
  • Setup linting checks
  • Only allow PRs that pass all checks to be merged
  • Lock coverage in at 100%

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.