feat(django): testing using backend django vs built in python

This commit is contained in:
darkicewolf50
2024-11-26 20:20:42 +00:00
parent 5c0ad44359
commit fa037fdb29
25 changed files with 246 additions and 0 deletions

View File

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View File

@ -0,0 +1,6 @@
from django.apps import AppConfig
class PollsConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "polls"

View File

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View File

@ -0,0 +1,11 @@
import json
from django.http import HttpResponse
def index(request):
ymlschedule = {"message": False}
res = {
"statusCode": 200,
"isBase64ENcoded": "false",
"body": json.dumps(ymlschedule)
}
return HttpResponse(json.dumps(res))

View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View File

@ -0,0 +1,9 @@
from django.urls import path
from . import views
from . import newtest
urlpatterns = [
path("", views.index, name="index"),
path("test", newtest.index, name="index")
]

View File

@ -0,0 +1,8 @@
# from django.shortcuts import render
# # Create your views here.
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world. You're at the polls index.")