Accepting request 918824 from devel:languages:python:django

- Switch to pytest-django from django-nose.

OBS-URL: https://build.opensuse.org/request/show/918824
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-django-seed?expand=0&rev=4
This commit is contained in:
Dominique Leuenberger 2021-09-14 19:14:29 +00:00 committed by Git OBS Bridge
commit 02207df640
3 changed files with 27 additions and 4 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Sep 14 06:22:59 UTC 2021 - Steve Kowalik <steven.kowalik@suse.com>
- Switch to pytest-django from django-nose.
-------------------------------------------------------------------
Thu Feb 20 08:57:06 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package python-django-seed
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -23,7 +23,8 @@ Release: 0
Summary: Django project fake data seeder
License: MIT
URL: https://github.com/brobin/django-seed
Source: https://files.pythonhosted.org/packages/source/d/django-seed/django-seed-%{version}.tar.gz
Source0: https://files.pythonhosted.org/packages/source/d/django-seed/django-seed-%{version}.tar.gz
Source1: settings.py
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@ -34,7 +35,8 @@ BuildArch: noarch
BuildRequires: %{python_module Django >= 1.11}
BuildRequires: %{python_module Faker >= 0.7.7}
BuildRequires: %{python_module coverage}
BuildRequires: %{python_module django-nose}
BuildRequires: %{python_module pytest-django}
BuildRequires: %{python_module pytest}
# /SECTION
%python_subpackages
@ -44,6 +46,7 @@ A module to seed Django projects with fake data.
%prep
%setup -q -n django-seed-%{version}
sed -i 's/fake-factory/Faker/' setup.py
cp %SOURCE1 django_seed
%build
%python_build
@ -53,7 +56,8 @@ sed -i 's/fake-factory/Faker/' setup.py
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%python_exec setup.py test
export DJANGO_SETTINGS_MODULE=django_seed.settings
%pytest %{buildroot}%{$python_sitelib}/django_seed/tests.py
%files %{python_files}
%license LICENSE

14
settings.py Normal file
View File

@ -0,0 +1,14 @@
from faker import Faker
fake = Faker()
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
INSTALLED_APPS=(
'django_seed',
)
SECRET_KEY=fake.sha1()