Skip to content

Commit

Permalink
Fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
amureki committed Apr 16, 2024
1 parent 7698653 commit 7a90ed8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 20 deletions.
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import os
import sys

sys.path.insert(0, os.path.abspath(".."))
from model_bakery import __about__

from model_bakery import __about__ # noqa
sys.path.insert(0, os.path.abspath(".."))

project = "Model Bakery"
copyright = "2023, Rust Saiargaliev"
Expand Down
2 changes: 1 addition & 1 deletion model_bakery/random_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# Postgres database.
MAX_INT = 100000000000

baker_random = Random()
baker_random = Random() # noqa: S311


def get_content_file(content: bytes, name: str) -> ContentFile:
Expand Down
14 changes: 3 additions & 11 deletions tests/generic/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,17 @@ class Person(models.Model):
occupation = models.CharField(max_length=10, choices=OCCUPATION_CHOICES)
uuid = models.UUIDField(primary_key=False)
name_hash = models.BinaryField(max_length=16)
days_since_last_login = models.BigIntegerField()
days_since_last_login = models.SmallIntegerField()
days_since_account_creation = models.BigIntegerField()
duration_of_sleep = models.DurationField()
email = models.EmailField()
id_document = models.CharField(unique=True, max_length=10)

try:
from django.db.models import JSONField

data = JSONField()
except ImportError:
# Skip JSONField-related fields
pass
data = models.JSONField()

try:
from django.contrib.postgres.fields import (
ArrayField,
HStoreField,
JSONField as PostgresJSONField,
)
from django.contrib.postgres.fields.citext import (
CICharField,
Expand All @@ -123,7 +116,6 @@ class Person(models.Model):
if django.VERSION >= (4, 2):
long_name = models.CharField()
acquaintances = ArrayField(models.IntegerField())
postgres_data = PostgresJSONField()
hstore_data = HStoreField()
ci_char = CICharField(max_length=30)
ci_email = CIEmailField()
Expand Down
9 changes: 3 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
[tox]
env_list =
py38-django{42}-{postgresql,sqlite}
py39-django{42}-{postgresql,sqlite}
py310-django{42,50}-{postgresql,sqlite}
py311-django{42,50}-{postgresql,sqlite}
py311-django{42,50}-{postgresql-psycopg3}
py312-django{42,50}-{postgresql-psycopg3}
py{38,39}-django{42}-{postgresql,sqlite}
py{310,311}-django{42,50}-{postgresql,sqlite}
py{311,312}-django{42,50}-{postgresql-psycopg3}

[testenv]
package = wheel
Expand Down

0 comments on commit 7a90ed8

Please sign in to comment.