semvec/pypi-packages huggingface dataset:
rest-framework-smoke 0.9.0
Smoke tests for API built with Django Rest Framework
License: MIT

Rest-Framework-Smoke
====================

Smoke tests for API built with Django Rest Framework.

![build](https://github.com/just-work/rest-framework-smoke/workflows/build/badge.svg?branch=master)
[![codecov](https://codecov.io/gh/just-work/rest-framework-smoke/branch/master/graph/badge.svg)](https://codecov.io/gh/just-work/rest-framework-smoke)
[![PyPI version](https://badge.fury.io/py/rest-framework-smoke.svg)](https://badge.fury.io/py/rest-framework-smoke)

Installation
------------

```shell script
pip install rest-framework-smoke
```

Usage
-----

Full example located at `testproject.testapp.tests`

```python
from rest_framework.test import APITestCase

from rest_framework_smoke.tests.mixins import ReadOnlyViewSetTestsMixin
from rest_framework_smoke.tests.schemas import get_object_schema
from testproject.testapp import models

TASK_SCHEMA = {
    "id": {"type": ["number"]},
    "name": {"type": ["string"]},
}

PROJECT_SCHEMA = {
    "id": {"type": ["number"]},
    "name": {"type": ["string"]},
    "task_set": {
        "type": ["array"],
        "minItems": 1,
        "items": get_object_schema(TASK_SCHEMA)
    }
}


class ProjectViewSetTestCase(ReadOnlyViewSetTestsMixin, APITestCase):
    object_name = 'project'
    basename = 'projects'
    schema = details_schema = PROJECT_SCHEMA
    pagination_schema = None

    @classmethod
    def setUpTestData(cls):
        cls.project = models.Project.objects.create(name='project')
        cls.task = models.Task.objects.create(name='task', project=cls.project)
```

Happy API testing :)

About schema checks
-------------------

Rest-Framework-Smoke uses `jsonschema` to validate API response format.
When we check format, we should pay attention to:
* no unexpected properties are found (is so, they are not validated by schema)
* there are no missing properties (missing properties are not validated)
* arrays are not empty (because there is nothing to check in empty arrays)
* all values are not null (because null values mostly are null by default, and
    other type variants will never appear in schema validation code)

So there are two helpers in `rest_framework_smoke.tests.schemas` to enforce 
these constraints (and they are used internally for format tests):
* `get_object_schema`
* `get_array_schema`
django-admin-blame 1.1.1
Tools for logging changes made from Django admin
License: MIT

django-admin-blame
==================

django-admin-blame is a Django app providing mixins for tracking date and author
of model changes from django admin.

[![Build Status](https://github.com/just-work/django-admin-blame/workflows/build/badge.svg?branch=master&event=push)](https://github.com/just-work/django-admin-blame/actions?query=event%3Apush+branch%3Amaster+workflow%3Abuild)
[![codecov](https://codecov.io/gh/just-work/django-admin-blame/branch/master/graph/badge.svg)](https://codecov.io/gh/just-work/django-admin-blame)
[![PyPI version](https://badge.fury.io/py/django-admin-blame.svg)](https://badge.fury.io/py/django-admin-blame)

Description
-----------

Often it is useful to know date and author of object creation or modification.
django-admin-blame provides a django model mixin with fields:
* created (datetime) - timestamp of object creation
* created_by (FK to User) - reference to an admin user who created this object
    through admin site
* modified (datetime) - timestamp of last object modification
* modified_by (FK to User) - reference to an admin user who made last changes to
    this object through admin site. If changes has been made somewhere else, 
    field value is reset to `None`.

Installation
------------

```shell script
pip install django-admin-blame
```

Working example is in `testproject.testapp`.

1. Enable middleware in django settings:
    ```python
    MIDDLEWARE.append('admin_log.middleware.AdminLogMiddleware')
    ```
2. Add model mixin to your models:
    ```python
    from django.db import models
    
    from admin_log.models import AdminLogMixin
    
    
    class Subject(AdminLogMixin, models.Model):
        title = models.CharField(max_length=50)
        content = models.TextField()
    ```
3. Add admin mixin to corresponding model admin:
    ```python
    from django.contrib import admin
    
    from admin_log.admin import AdminLogMixin
    from testproject.testapp import models
    
    
    @admin.register(models.Subject)
    class SubjectAdmin(AdminLogMixin, admin.ModelAdmin):
        pass
    ```

Now you have readonly fields with date and author of last revision in admin
"edit" page.
pillowdrawtable 0.2.1
Draw a table in pillow image
License: MIT
Requires Python: >=3.6
Keywords: Pillow,Table

# Drawtable in pillow image 
It used to draw a table in your pillow image by taking data, coordinates font etc

## Installation
```
pip install pillowdrawtable
```

Formats
- data format = [(1,0,1),(10,2,5)]
- font_path is a path of downloaded font from open resource
  

## Code Snippet 

```python
import PIL
text_font =   PIL.ImageFont.truetype("arial.ttf", 16) #PIL.ImageFont.truetype(FONT_PATH,FONTSIZE)
header_font =   PIL.ImageFont.truetype("arial.ttf", 16)
tdata= [("1",'2'),("19",100),("20",10)]
table = Drawtable(data=tdata,
                  x=60,
                  xend=400,
                  y=80,
                  font=text_font,
                  line_spacer=10,
                  margin_text=10,
                  image_width=500,
                  image_height=300,
                  frame=True,
                  grid=True,
                  columngrid=False,
                  rowgrid=False,
                  header=True,
                  text_color='green',
                  header_color='red',
                  headerfont=header_font,
                  save="outputtable2.png"
                 )
table.draw_table()
```

## Output

<p align="center" width="100%">
<img width="30%"src="https://raw.githubusercontent.com/dhanushnayak/drawpillowtable/main/output/outputtable.png">  
<img width="30%" src="https://raw.githubusercontent.com/dhanushnayak/drawpillowtable/main/output/outputtable2.png">
<img width="30%" src="https://raw.githubusercontent.com/dhanushnayak/drawpillowtable/main/output/outputtable1.png">
</p>

## License
Copyright (c) 2022 Dhanush Nayak