Skip to content

Convert utils test to pytest styled tests #856

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions example/tests/test_utils.py

This file was deleted.

129 changes: 0 additions & 129 deletions example/tests/unit/test_utils.py

This file was deleted.

37 changes: 37 additions & 0 deletions tests/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from django.db import models


class DJAModel(models.Model):
"""
Base for test models that sets app_label, so they play nicely.
"""

class Meta:
app_label = 'tests'
abstract = True


class BasicModel(DJAModel):
text = models.CharField(max_length=100)


# Models for relations tests
# ManyToMany
class ManyToManyTarget(DJAModel):
name = models.CharField(max_length=100)


class ManyToManySource(DJAModel):
name = models.CharField(max_length=100)
targets = models.ManyToManyField(ManyToManyTarget, related_name='sources')


# ForeignKey
class ForeignKeyTarget(DJAModel):
name = models.CharField(max_length=100)


class ForeignKeySource(DJAModel):
name = models.CharField(max_length=100)
target = models.ForeignKey(ForeignKeyTarget, related_name='sources',
on_delete=models.CASCADE)
Loading