Commit Graph

101 Commits

Author SHA1 Message Date
Andrew-Chen-Wang
c839862aef Testing mail service does not raise KeyError
* KeyError raised when cloud_provider was used twice in mark parametrization.
* Tox isn't working properly for me (collecting 17,000 files; obviously neglecting tox.ini and/or pytest.ini)
2020-02-06 22:12:30 -05:00
Andrew-Chen-Wang
0df8cfdb90 Added mail service pytests in test_cookiecutter_generation.py 2020-02-06 21:03:49 -05:00
Bruno Alla
2f6cb4e8f6 Fix deprecation warning 2020-02-03 12:29:37 +00:00
Bruno Alla
2698867cf8 Typo 2020-01-28 10:33:24 +00:00
Bruno Alla
2833600aec Test generation with and without DRF 2020-01-23 14:43:17 +00:00
Ivan Khomutov
113ce88d9c Add option to choose CI tool 2019-12-06 10:55:00 +03:00
Bruno Alla
5750330ac2 Merge whitenoise & cloud provider parametrize in tests 2019-10-06 10:28:15 +01:00
Caio Ariede
4f8834c0eb
Update tests/test_cookiecutter_generation.py
Co-Authored-By: Bruno Alla <browniebroke@users.noreply.github.com>
2019-10-03 11:54:15 -03:00
Caio Ariede
9fffafc095 Add docstring 2019-10-02 12:06:53 -03:00
Caio Ariede
d0c208d10f Fix #2249 -- Broken static files with whitenoise=n & cloud_provider=none 2019-10-02 12:03:33 -03:00
Bruno Alla
aaf5d8d8f5 Run tests on bare metal
Install with Celery and compressor as it requires compilation

closes #1677
2019-06-18 21:02:37 +01:00
Bruno Alla
2103cf2f9d Add a pre-generation hook to avoid non-lowercase slugs - fixes #2042 2019-06-05 19:00:43 +01:00
Bruno Alla
47937fce79 Fix deprecation warning in tests 2019-05-27 16:54:08 +01:00
Tano Abeleyra
de7be3652a Make cloud_provider optional
Some projects may not need AWS or GCS
2019-05-19 12:45:28 -03:00
Bruno Alla
a245651f66 Increase test parallelism
- Split out tests and add markers to control where they are run in Travis
- Run each marker on a separate Travis task
- Install pytest-xdist to increase parallelism inside each worker
- Set xdist parallelism to 3
2019-05-15 12:37:17 +01:00
anuj
b5e030b784 Corrected quotes, added parameter in tests 2019-04-07 00:34:22 +05:30
Bruno Alla
1d420157c1 Revert accidental commit 2019-04-02 15:10:14 +01:00
Bruno Alla
6d48275e5f Fix Heroku docs 2019-04-02 10:33:38 +01:00
Bruno Alla
4e70a4b55a
Test all possible template combinations (#1993)
## Description

Fixes #591.

## Rationale

We are currently not testing many combinations, we run Flake8 on the generated project with default options, but that rarely catch any issues.

## Use case(s) / visualization(s)

Catch problems with invalid combinations, for instance, it fails due to Whitenoise breaking flake8 with `django-compressor` because `STATIC_URL` was undefined here:

b91c70d755/%7B%7Bcookiecutter.project_slug%7D%7D/config/settings/production.py (L185)
2019-04-01 08:47:46 +01:00
Bruno Alla
68f7268770
Run Black on Travis (#1957)
* Create a test matrix on Travis CI to help testing multiple options

* Change test_docker.sh to fail if any command in it fails

* Run black on the CI with --check option

* Fix formatting of project files using black

* Install black in the docker container

* Exclude migrations in black checks

* Fix Black formatting violations

* Run black on the whole generated project & fix issues
2019-03-18 17:49:43 +00:00
btknu
6e72169ffe Add missing script key to Travis CI config (#1950)
* Add failing test for travis.yml

I see three options to test travis.yml :

1. Testing that the YAML contains relevant value. Least useful and least
reliable, but simplest to implement.

2. Testing that the YAML is valid TravisCI YAML. Unfortunately this is
difficult / impossible. Doing 'travis lint' would succeed, this command
does not check for 'script' key presence and wouldn't be useful for us.

We could use 'travis-build' to verify that the YAML can be converted to
a worker config, but as of now 'travis-build' doesn't work out of the
box.

There is a new tool for validating travis YAML files 'travis-yml', but
as of now it's a ruby-only library and it's still a work in progress.

3. Running Travis CI task based on the generated YAML. This seems the
best approach, however since cookiecutter-django itself uses Travis CI,
that would require running Travis CI from within Travis CI.

Scheduling Travis CI job without a github push still requires a public
github repo, which is something that we can't generate on demand.

Given that I'm opting to use approach 1.

* Adds missing config to generated .travis.yml

The keys added are as follows:

1. 'script'

Required by Travis, cookiecutter-django used to provide it until it has
been removed together with hitch.

I'm assuming hitch has been replaced with pytest, I'm setting pytest as
the new value for the 'script' key.

2. 'install'

Not required by Travis, but necessary in our case; installs test
libraries, mostly pytest.

As of now this points to 'local.txt' requirements file. There used to be
a separate 'test.txt' requirements file but it has been decided to merge
it with 'local.txt', see discussion in
https://github.com/pydanny/cookiecutter-django/pull/1557 .

* Update CONTRIBUTORS.rst
2019-03-05 22:10:45 -03:00
Bruno Alla
b5d782e252
Merge branch 'master' into mypy 2018-08-29 08:21:22 +01:00
Denis Orehovsky
80e0862ff0 Fix running tests in test_docker.sh file 2018-08-19 14:22:33 +03:00
Denis Orehovsky
c18a2fca8c Run type checks in test_docker 2018-08-19 14:08:29 +03:00
John Cass
bb01d961ed Use pytest's recommended command as the entry point for running tests. 2018-07-23 08:51:06 +02:00
Nikita P. Shupeyko
de56ad9099 Remove redundant js_task_runner declaration from test_docker.sh 2018-05-21 21:37:42 +03:00
Daniel Roy Greenfeld
3f753e0411
First pass at running black across the project (#1602) 2018-04-08 17:03:29 -05:00
Nikita P. Shupeyko
20a43c2bc5 Simplify test_docker.sh 2018-03-05 14:26:12 +03:00
Nikita P. Shupeyko
fe6fe1cc76 Fix test_docker.sh 2018-03-04 15:18:27 +03:00
Bruno Alla
0164c330b3 Move to the python:alpine docker image (#1482)
* Move to the python:alpine docker image

- Switch the base images for local and production to alpine
- Install extra dependencies for psycopg2, Pillow and cffi
- Change shebang for shell scripts to use sh instead of bash

* Move to the python:alpine docker image

- Migrate group and user creation to Alpine syntax

* Move to the python:alpine docker image

- Remove `function` keyword, unsupported in shell

* Upgrade various places to the latest Python 3.6

* Test support for translations

* Add gettext library, required for translations support

* Add locale folder for translations support with README documenting it

* Update Changelog

* Tweak command to test translations support
2018-02-22 10:01:05 -05:00
Shupeyko Nikita
e889316b11 Rename dev.yml to local.yml (#1227)
* Rename dev.yml to local.yml

Closes #1226.

* Rename docker-compose.yml to production.yml
2017-07-14 17:09:41 +03:00
Daniel Roy Greenfeld
6aced9ba73 Remove Python 2.7 support per #1129 (#1130)
* Remove Python 2.7 support per

* Remove Python 2.7 references

* Remove Python 2.7 references

* remove python 2 entirely
2017-04-21 12:31:45 -07:00
Fabio C. Barrioneuvo da Luz
d0cd31e019 fix docker build on travis-ci 2017-02-15 17:27:12 -03:00
Fábio C. Barrionuevo da Luz
ab4686f519 check pending migration (#840) 2016-10-08 17:43:12 -07:00
Steve Steiner
d556f3cc5f Make test_docker.sh tests pass by passing new password auth rules 2016-09-29 01:01:01 -03:00
Daniel Roy Greenfeld
b2d0a86344 simplify cookiecutter.json 2016-06-04 17:16:48 -07:00
Audrey Roy Greenfeld
fb59c5117b More repo_name -> project_slug cleanup 2016-04-20 11:41:17 -07:00
Audrey Roy Greenfeld
7cb5c0bba4 Update test fixture to use project_slug, not repo_name 2016-04-20 11:28:34 -07:00
Bo Lopker
a300f1190d Quote consistency 2016-04-15 23:29:04 -07:00
Jay
82a30ea88c adds simple docker test 2016-01-18 12:26:25 +01:00
Tom Atkins
3316a3b023 Fix merge conflict in README.rst 2015-11-18 11:16:25 +00:00
Raphael Pierzina
87025216c2 Remove unittest modules altogether 2015-11-09 00:33:41 +01:00
Raphael Pierzina
664c72d291 Implement test for flake8 compliance 2015-11-09 00:33:41 +01:00
Raphael Pierzina
f579cf08ac Implement parametrized test for enabled features 2015-11-09 00:33:41 +01:00
Raphael Pierzina
646e376a8e Integrate additional checks of base.py with slight improvements 2015-11-09 00:33:41 +01:00
Raphael Pierzina
6c339a1417 Implement a basic test with cookies.bake() 2015-11-09 00:33:41 +01:00
Audrey Roy Greenfeld
7e8f58d6ec Fix test failure due to favicon.ico being opened by DjangoCookieTestCase.check_paths(). 2015-11-06 19:44:10 -08:00
Burhan Khalid
9e3a92e3ee adding individual test methods, fixed typo. 2015-07-29 00:17:28 +03:00
Burhan Khalid
34d56787c4 refactoring out common method to base class 2015-07-29 00:11:06 +03:00
Saurabh Kumar
43d33dc025 Add DjangoCookieTestCase 2015-04-20 18:03:28 +05:30
Kevin Ndung'u
5287b001c6 Add test for cookiecutter substitution 2015-03-27 16:56:55 +03:00