From 80f4a4d17b01acb1c70599b7f5b75c09d16ace61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Pe=C3=B1a?= Date: Thu, 21 Jan 2021 18:11:53 -0800 Subject: [PATCH] added truck test --- truck/google_api/google_api 3.css | 4 ---- truck/google_api/google_api 3.html | 15 --------------- truck/google_api/google_api.html | 15 --------------- truck/ip_stack/ip_stack.py | 15 --------------- truck/tests.py | 13 +++++++++++-- 5 files changed, 11 insertions(+), 51 deletions(-) delete mode 100644 truck/google_api/google_api 3.css delete mode 100644 truck/google_api/google_api 3.html delete mode 100644 truck/google_api/google_api.html delete mode 100644 truck/ip_stack/ip_stack.py diff --git a/truck/google_api/google_api 3.css b/truck/google_api/google_api 3.css deleted file mode 100644 index 632d76f..0000000 --- a/truck/google_api/google_api 3.css +++ /dev/null @@ -1,4 +0,0 @@ -#map { - height: 400px; - width: 60%; - } diff --git a/truck/google_api/google_api 3.html b/truck/google_api/google_api 3.html deleted file mode 100644 index a09f48e..0000000 --- a/truck/google_api/google_api 3.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - -
- - - - diff --git a/truck/google_api/google_api.html b/truck/google_api/google_api.html deleted file mode 100644 index a09f48e..0000000 --- a/truck/google_api/google_api.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - -
- - - - diff --git a/truck/ip_stack/ip_stack.py b/truck/ip_stack/ip_stack.py deleted file mode 100644 index 766a3d7..0000000 --- a/truck/ip_stack/ip_stack.py +++ /dev/null @@ -1,15 +0,0 @@ -# Works but location is to far away from actual - -import requests -import json - -def ip_static_locator(): - send_url = "http://api.ipstack.com/check?access_key=86a56dc7c1b3d9a9ac5742ae357fb74f" - geo_req = requests.get(send_url) - geo_json = json.loads(geo_req.text) - latitude = geo_json['latitude'] - longitude = geo_json['longitude'] - city = geo_json['city'] - print(city, latitude, longitude) - -ip_static_locator() diff --git a/truck/tests.py b/truck/tests.py index e130ad5..c053c21 100644 --- a/truck/tests.py +++ b/truck/tests.py @@ -2,13 +2,22 @@ from django.contrib.auth.models import User from django.test import TestCase -from .models import TruckInstance, MenuItem +from .models import TruckInstance, MenuItem, class TruckInstanceTestCase(TestCase): def setUp(self): self.menuItem = MenuItem.objects.create(item="Hummus", description="drizzle with olive oil", cost=3.99) - + self.truckInstance = TruckInstance.objects.create(owner = "Alex", name = "Alex's Hot Dogs", menu = menuItem, location = "5301 156thst. SE, Bothell, WA 98012", contact = "4253455395", album = models.ManyToManyField(ImageLink, blank=True) +) + def test_menu_item_exists(self): self.assertIsNotNone(self.menuItem) + def test_truck_exists(self): + self.assertIsNotNone(self.truckInstance) + + + + +