Skip to content

Commit

Permalink
Add last changes in the time we had
Browse files Browse the repository at this point in the history
  • Loading branch information
pydanny committed Oct 4, 2020
1 parent a2cb52e commit 4ecd09f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 8 additions & 1 deletion everycheese/cheeses/tests/factories.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import pytest

from django.template.defaultfilters import slugify

import factory
Expand All @@ -20,4 +22,9 @@ class CheeseFactory(factory.django.DjangoModelFactory):
creator = factory.SubFactory(UserFactory)

class Meta:
model = Cheese
model = Cheese


@pytest.fixture
def cheese():
return CheeseFactory()
5 changes: 2 additions & 3 deletions everycheese/cheeses/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


from .factories import UserFactory
from .factories import CheeseFactory
from .factories import CheeseFactory, cheese
from ..models import Cheese
from ..views import (
CheeseListView,
Expand Down Expand Up @@ -40,8 +40,7 @@ def test_good_cheese_list_view(rf):
assertContains(response, 'Cheese List')


def test_good_cheese_detail_view(rf):
cheese = CheeseFactory()
def test_good_cheese_detail_view(rf, cheese):
url = reverse('cheeses:detail',
kwargs={'slug': cheese.slug}
)
Expand Down

0 comments on commit 4ecd09f

Please sign in to comment.