Projet

Général

Profil

« Précédent | Suivant » 

Révision bf5d84a3

Ajouté par Serghei Mihai (congés, retour 15/05) il y a plus de 7 ans

use unique category slugs in urls (#13791)

Voir les différences:

tests/test_emailing.py
9 9
from django.core import mail, signing
10 10
from django.utils import timezone
11 11
from django.core.files.storage import DefaultStorage
12
from django.utils.text import slugify
12 13

  
13 14
from corbo.models import Category, Announce, Subscription, Broadcast, transform_image_src
14 15

  
15 16
pytestmark = pytest.mark.django_db
16 17

  
17
CATEGORIES = ('Alerts', 'News')
18
CATEGORIES = (u'Alerts', u'News')
18 19

  
19 20

  
20 21
@pytest.fixture
21 22
def categories():
22 23
    categories = []
23 24
    for category in CATEGORIES:
24
        c, created = Category.objects.get_or_create(name=category)
25
        c, created = Category.objects.get_or_create(name=category, slug=slugify(category))
25 26
        categories.append(c)
26 27
    return categories
27 28

  

Formats disponibles : Unified diff