mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-03 12:44:22 -07:00
Django integration tests (#1607)
* added integration test for module django_manage * Initial attempt at integration tests for django_manage * added ignore lines for django python code * added more ignore lines for django python code * removed a couple of extraneous files and ignore lines * also removed urls.py, as it is not required for testing * added test group to aliases file * Adding a few lines attempting to remove py2 from the equation. * restricted integration tests platforms * restricted integration tests platforms (moving to aliases) * foce using a virtualenv for the test, to avoid differences in different OSes * Adding urls.py back to the test project * Adding ignore lines for urls.py * Updated aliases for the testing
This commit is contained in:
parent
f1a31611b7
commit
b9408dc8ef
12 changed files with 272 additions and 0 deletions
50
tests/integration/targets/django_manage/tasks/main.yaml
Normal file
50
tests/integration/targets/django_manage/tasks/main.yaml
Normal file
|
@ -0,0 +1,50 @@
|
|||
# Test code for django_manage module
|
||||
#
|
||||
# Copyright: (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
- name: Create temporary test directory
|
||||
tempfile:
|
||||
state: directory
|
||||
suffix: .django_manage
|
||||
register: tmp_django_root
|
||||
|
||||
- name: Install required library
|
||||
pip:
|
||||
name: django
|
||||
state: present
|
||||
virtualenv: "{{ tmp_django_root.path }}/venv"
|
||||
|
||||
- name: Copy files
|
||||
copy:
|
||||
src: base_test/
|
||||
dest: "{{ tmp_django_root.path }}"
|
||||
mode: preserve
|
||||
|
||||
- name: Create project
|
||||
command:
|
||||
chdir: "{{ tmp_django_root.path }}/startproj"
|
||||
cmd: "{{ tmp_django_root.path }}/venv/bin/django-admin startproject test_django_manage_1"
|
||||
|
||||
- name: Create app
|
||||
command:
|
||||
chdir: "{{ tmp_django_root.path }}/startproj"
|
||||
cmd: "{{ tmp_django_root.path }}/venv/bin/django-admin startapp app1"
|
||||
|
||||
- name: Check
|
||||
community.general.django_manage:
|
||||
project_path: "{{ tmp_django_root.path }}/startproj/test_django_manage_1"
|
||||
command: check
|
||||
virtualenv: "{{ tmp_django_root.path }}/venv"
|
||||
|
||||
- name: Check simple_project
|
||||
community.general.django_manage:
|
||||
project_path: "{{ tmp_django_root.path }}/simple_project/p1"
|
||||
command: check
|
||||
virtualenv: "{{ tmp_django_root.path }}/venv"
|
||||
|
||||
- name: Check custom project
|
||||
community.general.django_manage:
|
||||
project_path: "{{ tmp_django_root.path }}/1045-single-app-project/single_app_project"
|
||||
pythonpath: "{{ tmp_django_root.path }}/1045-single-app-project/"
|
||||
command: check
|
||||
virtualenv: "{{ tmp_django_root.path }}/venv"
|
Loading…
Add table
Add a link
Reference in a new issue