Skip to content

Commit

Permalink
delete obsolete tests + fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vabene1111 committed Jan 19, 2025
1 parent cba80ae commit e8cbd91
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 206 deletions.
83 changes: 0 additions & 83 deletions cookbook/tests/edits/test_edits_recipe.py

This file was deleted.

150 changes: 75 additions & 75 deletions cookbook/tests/views/test_views_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,81 +2,81 @@
from django.urls import reverse


@pytest.mark.parametrize("arg", [
['a_u', 302],
['g1_s1', 302],
['u1_s1', 302],
['a1_s1', 302],
])
def test_index(arg, request, ext_recipe_1_s1):
c = request.getfixturevalue(arg[0])
assert c.get(reverse('index')).status_code == arg[1]


@pytest.mark.parametrize("arg", [
['a_u', 302],
['g1_s1', 200],
['u1_s1', 200],
['a1_s1', 200],
])
def test_search(arg, request, ext_recipe_1_s1):
c = request.getfixturevalue(arg[0])
assert c.get(reverse('view_search')).status_code == arg[1]


@pytest.mark.parametrize("arg", [
['a_u', 302],
['g1_s1', 302],
['u1_s1', 200],
['a1_s1', 200],
])
def test_books(arg, request, ext_recipe_1_s1):
c = request.getfixturevalue(arg[0])
assert c.get(reverse('view_books')).status_code == arg[1]


@pytest.mark.parametrize("arg", [
['a_u', 302],
['g1_s1', 302],
['u1_s1', 200],
['a1_s1', 200],
])
def test_plan(arg, request, ext_recipe_1_s1):
c = request.getfixturevalue(arg[0])
assert c.get(reverse('view_plan')).status_code == arg[1]


@pytest.mark.parametrize("arg", [
['a_u', 302],
['g1_s1', 302],
['u1_s1', 200],
['a1_s1', 200],
])
def test_shopping(arg, request, ext_recipe_1_s1):
c = request.getfixturevalue(arg[0])
assert c.get(reverse('view_shopping')).status_code == arg[1]


@pytest.mark.parametrize("arg", [
['a_u', 302],
['g1_s1', 200],
['u1_s1', 200],
['a1_s1', 200],
])
def test_settings(arg, request, ext_recipe_1_s1):
c = request.getfixturevalue(arg[0])
assert c.get(reverse('view_settings')).status_code == arg[1]


@pytest.mark.parametrize("arg", [
['a_u', 302],
['g1_s1', 200],
['u1_s1', 200],
['a1_s1', 200],
])
def test_history(arg, request, ext_recipe_1_s1):
c = request.getfixturevalue(arg[0])
assert c.get(reverse('view_history')).status_code == arg[1]
# @pytest.mark.parametrize("arg", [
# ['a_u', 302],
# ['g1_s1', 302],
# ['u1_s1', 302],
# ['a1_s1', 302],
# ])
# def test_index(arg, request, ext_recipe_1_s1):
# c = request.getfixturevalue(arg[0])
# assert c.get(reverse('index')).status_code == arg[1]
#
#
# @pytest.mark.parametrize("arg", [
# ['a_u', 302],
# ['g1_s1', 200],
# ['u1_s1', 200],
# ['a1_s1', 200],
# ])
# def test_search(arg, request, ext_recipe_1_s1):
# c = request.getfixturevalue(arg[0])
# assert c.get(reverse('view_search')).status_code == arg[1]
#
#
# @pytest.mark.parametrize("arg", [
# ['a_u', 302],
# ['g1_s1', 302],
# ['u1_s1', 200],
# ['a1_s1', 200],
# ])
# def test_books(arg, request, ext_recipe_1_s1):
# c = request.getfixturevalue(arg[0])
# assert c.get(reverse('view_books')).status_code == arg[1]
#
#
# @pytest.mark.parametrize("arg", [
# ['a_u', 302],
# ['g1_s1', 302],
# ['u1_s1', 200],
# ['a1_s1', 200],
# ])
# def test_plan(arg, request, ext_recipe_1_s1):
# c = request.getfixturevalue(arg[0])
# assert c.get(reverse('view_plan')).status_code == arg[1]
#
#
# @pytest.mark.parametrize("arg", [
# ['a_u', 302],
# ['g1_s1', 302],
# ['u1_s1', 200],
# ['a1_s1', 200],
# ])
# def test_shopping(arg, request, ext_recipe_1_s1):
# c = request.getfixturevalue(arg[0])
# assert c.get(reverse('view_shopping')).status_code == arg[1]
#
#
# @pytest.mark.parametrize("arg", [
# ['a_u', 302],
# ['g1_s1', 200],
# ['u1_s1', 200],
# ['a1_s1', 200],
# ])
# def test_settings(arg, request, ext_recipe_1_s1):
# c = request.getfixturevalue(arg[0])
# assert c.get(reverse('view_settings')).status_code == arg[1]
#
#
# @pytest.mark.parametrize("arg", [
# ['a_u', 302],
# ['g1_s1', 200],
# ['u1_s1', 200],
# ['a1_s1', 200],
# ])
# def test_history(arg, request, ext_recipe_1_s1):
# c = request.getfixturevalue(arg[0])
# assert c.get(reverse('view_history')).status_code == arg[1]


@pytest.mark.parametrize("arg", [
Expand Down
45 changes: 0 additions & 45 deletions cookbook/tests/views/test_views_recipe_share.py

This file was deleted.

10 changes: 7 additions & 3 deletions cookbook/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ def extend(self, r):
path('service-worker.js', (TemplateView.as_view(template_name="sw.js", content_type='application/javascript')), name='service_worker'),
path('manifest.json', views.web_manifest, name='web_manifest'),

re_path(r'^v3/.*', views.vue3, name='vue_3'),
path('', views.index, name='index'),
path('<path:resource>', views.index, name='tandoor_frontend'),
]

generic_models = (Recipe, RecipeImport, Storage, ConnectorConfig, RecipeBook, SyncLog, Sync, Comment, RecipeBookEntry, InviteLink, UserSpace, Space)
Expand Down Expand Up @@ -167,3 +164,10 @@ def extend(self, r):
if DEBUG:
urlpatterns.append(path('test/', views.test, name='view_test'))
urlpatterns.append(path('test2/', views.test2, name='view_test2'))

# catchall view for new frontend
urlpatterns += [
re_path(r'^v3/.*', views.vue3, name='vue_3'),
path('', views.index, name='index'),
path('<path:resource>', views.index, name='tandoor_frontend'),
]

0 comments on commit e8cbd91

Please sign in to comment.