diff --git a/backend/Zola/vueapi/tests.py b/backend/Zola/vueapi/tests.py deleted file mode 100644 index 2fb68e8..0000000 --- a/backend/Zola/vueapi/tests.py +++ /dev/null @@ -1,123 +0,0 @@ -from django.test import TestCase -from rest_framework.test import APITestCase -from .models import Profile, Item, Payment -from PIL import Image -from io import BytesIO -from django.core.files.base import File -import datetime -from django.utils import timezone - -''' -Run with: -python manage.py test vueapi -''' - -class LoginTest(APITestCase): - - def setUp(self): - self.profile = Profile.objects.create( - username='testuser', name='georges stpierre', shipping_addr='123 the street') - self.profile.set_password('123123') - self.profile.save() - - def test_correct(self): - ''' - Test correct login information - ''' - resp = self.client.post('/api/rest-auth/login/', - {'username': 'testuser', 'password': '123123'}) - self.assertEqual(200, resp.status_code) - - def test_incorrect(self): - ''' - Test logging in with incorrect password - ''' - resp = self.client.post('/api/rest-auth/login/', - {'username': 'testuser', 'password': 'asdasd'}) - self.assertEqual(400, resp.status_code) - - def test_userdoesntexist(self): - ''' - Test loggin in with non existent user - ''' - resp = self.client.post( - '/api/rest-auth/login/', {'username': 'bigdawg', 'password': 'youngthug123'}) - self.assertEqual(400, resp.status_code) - - -class ItemTest(APITestCase): - def setUp(self): - self.profile = Profile.objects.create( - username='testuser', name='georges stpierre', shipping_addr='123 the street') - self.profile.set_password('123123') - self.profile.save() - resp = self.client.post('/api/rest-auth/login/', - {'username': 'testuser', 'password': '123123'}) - - def get_img(self): - ''' - create temp image file to test with - ''' - thefile = BytesIO() - img = Image.new("RGBA", size=(50, 50), color=(110, 0, 0)) - img.save(thefile, 'png') - thefile.name = 'test.png' - thefile.seek(0) - return thefile - - def test_createitem(self): - ''' - Test creating an item - ''' - pic = self.get_img() - print(self.profile.id) - data = {'username': self.profile.id, 'mediatype': 'cd', 'genre': 'grindcore', 'artist': 'sufjan stevens', 'title': 'heavy weather', - 'description': 'it slaps', 'inventory_count': 5, 'price': 5.99, 'release_year': '2019-01-01', 'photo': pic} - resp = self.client.post('/api/items/', data) - self.assertEqual(201, resp.status_code) - - def test_updateitem(self): - ''' - Test updating the item defined above - ''' - data = {'genre': 'crustpunk', 'artist': 'justin bieber', 'title': 'harvest'} - resp = self.client.patch('/api/partialupdate/1/', data) - self.assertEqual(200, resp.status_code) - - -class PaymentTest(APITestCase): - - def get_img(self): - ''' - create temp image file to test with - ''' - thefile = BytesIO() - img = Image.new("RGBA", size=(50, 50), color=(110, 0, 0)) - img.save(thefile, 'png') - thefile.name = 'test.png' - thefile.seek(0) - return thefile - - def setUp(self): - - self.profile = Profile.objects.create( - username='testuser', name='georges stpierre', shipping_addr='123 the street') - self.profile.set_password('123123') - self.profile.save() - resp = self.client.post('/api/rest-auth/login/', - {'username': 'testuser', 'password': '123123'}) - - - - def test_paymentnotinfuture(self): - ''' - assert that a payment creation date is now or in the past - ''' - pic = self.get_img() - data = {'username': self.profile.id, 'mediatype': 'cd', 'genre': 'grindcore', 'artist': 'sufjan stevens', 'title': 'heavy weather', - 'description': 'it slaps', 'inventory_count': 5, 'price': 5.99, 'release_year': '2019-01-01', 'photo': pic} - resp = self.client.post('/api/items/', data) - self.item = Item.objects.get(pk=1) - self.payment = Payment.objects.create(username=self.profile, iId=self.item, shipping_addr='asd', total_amt=5.99) - time = timezone.now() - self.assertLessEqual(self.payment.pDate, time.date()) diff --git a/frontend/src/layouts/MainLayout.vue b/frontend/src/layouts/MainLayout.vue index 8545148..87cf65f 100644 --- a/frontend/src/layouts/MainLayout.vue +++ b/frontend/src/layouts/MainLayout.vue @@ -121,12 +121,6 @@ export default { } }, methods: { - // showNotif() { - // this.$q.notify({ - // message: "Added to basket", - // icon: "add" - // }); - // } logout: function() { this.$store.dispatch("logout").then(this.$router.push({ path: "login" })); } diff --git a/frontend/src/pages/EditProfile.vue b/frontend/src/pages/EditProfile.vue index 9422a56..91ed466 100644 --- a/frontend/src/pages/EditProfile.vue +++ b/frontend/src/pages/EditProfile.vue @@ -59,7 +59,6 @@ export default { }, methods: { onFileChanged: function(event) { - // console.log(event.target.files[0].type); this.newProfilePic = event.target.files[0]; this.profile_pic = URL.createObjectURL(event.target.files[0]); this.picChanged = true; diff --git a/frontend/src/pages/Home.vue b/frontend/src/pages/Home.vue index 4680d30..f38eef5 100644 --- a/frontend/src/pages/Home.vue +++ b/frontend/src/pages/Home.vue @@ -1,20 +1,25 @@ diff --git a/frontend/src/pages/Messages.vue b/frontend/src/pages/Messages.vue index 4030aa0..6539fd7 100644 --- a/frontend/src/pages/Messages.vue +++ b/frontend/src/pages/Messages.vue @@ -72,7 +72,6 @@ export default { }; ws.onopen = () => { - console.log("WEBSOCKET OPEN BOIIII"); sendMessage({ command: "fetch_messages", username: this.username }); }; @@ -88,11 +87,8 @@ export default { if (command == "new_message") { var m = this.messages; - //lol this.messages = [...m, message]; } - - console.log(this.messages, "xxxxxxxxxxxx"); }; const sendMessage = messageObject => { diff --git a/backend/Zola/Zola/__init__.py b/newbackend/Zola/Zola/__init__.py similarity index 100% rename from backend/Zola/Zola/__init__.py rename to newbackend/Zola/Zola/__init__.py diff --git a/backend/Zola/Zola/asgi.py b/newbackend/Zola/Zola/asgi.py similarity index 100% rename from backend/Zola/Zola/asgi.py rename to newbackend/Zola/Zola/asgi.py diff --git a/backend/Zola/Zola/routing.py b/newbackend/Zola/Zola/routing.py similarity index 100% rename from backend/Zola/Zola/routing.py rename to newbackend/Zola/Zola/routing.py diff --git a/backend/Zola/Zola/settings.py b/newbackend/Zola/Zola/settings.py similarity index 100% rename from backend/Zola/Zola/settings.py rename to newbackend/Zola/Zola/settings.py diff --git a/backend/Zola/Zola/urls.py b/newbackend/Zola/Zola/urls.py similarity index 100% rename from backend/Zola/Zola/urls.py rename to newbackend/Zola/Zola/urls.py diff --git a/backend/Zola/Zola/wsgi.py b/newbackend/Zola/Zola/wsgi.py similarity index 100% rename from backend/Zola/Zola/wsgi.py rename to newbackend/Zola/Zola/wsgi.py diff --git a/backend/Zola/albumart/acidrap.jpg b/newbackend/Zola/albumart/acidrap.jpg similarity index 100% rename from backend/Zola/albumart/acidrap.jpg rename to newbackend/Zola/albumart/acidrap.jpg diff --git a/backend/Zola/albumart/acidrap_T7nNwW6.jpg b/newbackend/Zola/albumart/acidrap_T7nNwW6.jpg similarity index 100% rename from backend/Zola/albumart/acidrap_T7nNwW6.jpg rename to newbackend/Zola/albumart/acidrap_T7nNwW6.jpg diff --git a/backend/Zola/albumart/acidrap_tn3gUAz.jpg b/newbackend/Zola/albumart/acidrap_tn3gUAz.jpg similarity index 100% rename from backend/Zola/albumart/acidrap_tn3gUAz.jpg rename to newbackend/Zola/albumart/acidrap_tn3gUAz.jpg diff --git a/backend/Zola/albumart/ape.jpg b/newbackend/Zola/albumart/ape.jpg similarity index 100% rename from backend/Zola/albumart/ape.jpg rename to newbackend/Zola/albumart/ape.jpg diff --git a/backend/Zola/albumart/billie.jpg b/newbackend/Zola/albumart/billie.jpg similarity index 100% rename from backend/Zola/albumart/billie.jpg rename to newbackend/Zola/albumart/billie.jpg diff --git a/backend/Zola/albumart/bob_dylan.jpg b/newbackend/Zola/albumart/bob_dylan.jpg similarity index 100% rename from backend/Zola/albumart/bob_dylan.jpg rename to newbackend/Zola/albumart/bob_dylan.jpg diff --git a/backend/Zola/albumart/boniver_new.jpg b/newbackend/Zola/albumart/boniver_new.jpg similarity index 100% rename from backend/Zola/albumart/boniver_new.jpg rename to newbackend/Zola/albumart/boniver_new.jpg diff --git a/backend/Zola/albumart/doja.jpg b/newbackend/Zola/albumart/doja.jpg similarity index 100% rename from backend/Zola/albumart/doja.jpg rename to newbackend/Zola/albumart/doja.jpg diff --git a/backend/Zola/albumart/flower_boy.jpeg b/newbackend/Zola/albumart/flower_boy.jpeg similarity index 100% rename from backend/Zola/albumart/flower_boy.jpeg rename to newbackend/Zola/albumart/flower_boy.jpeg diff --git a/backend/Zola/albumart/gor.PNG b/newbackend/Zola/albumart/gor.PNG similarity index 100% rename from backend/Zola/albumart/gor.PNG rename to newbackend/Zola/albumart/gor.PNG diff --git a/backend/Zola/albumart/graduation.jpg b/newbackend/Zola/albumart/graduation.jpg similarity index 100% rename from backend/Zola/albumart/graduation.jpg rename to newbackend/Zola/albumart/graduation.jpg diff --git a/backend/Zola/albumart/graduation_WXbHAh2.jpg b/newbackend/Zola/albumart/graduation_WXbHAh2.jpg similarity index 100% rename from backend/Zola/albumart/graduation_WXbHAh2.jpg rename to newbackend/Zola/albumart/graduation_WXbHAh2.jpg diff --git a/backend/Zola/albumart/harryfinelinealbumcover.jpg b/newbackend/Zola/albumart/harryfinelinealbumcover.jpg similarity index 100% rename from backend/Zola/albumart/harryfinelinealbumcover.jpg rename to newbackend/Zola/albumart/harryfinelinealbumcover.jpg diff --git a/backend/Zola/profilepics/harryfinelinealbumcover.jpg b/newbackend/Zola/albumart/harryfinelinealbumcover_p4S50rR.jpg similarity index 100% rename from backend/Zola/profilepics/harryfinelinealbumcover.jpg rename to newbackend/Zola/albumart/harryfinelinealbumcover_p4S50rR.jpg diff --git a/backend/Zola/albumart/lorde_melodrama.jpg b/newbackend/Zola/albumart/lorde_melodrama.jpg similarity index 100% rename from backend/Zola/albumart/lorde_melodrama.jpg rename to newbackend/Zola/albumart/lorde_melodrama.jpg diff --git a/backend/Zola/profilepics/lorde_melodrama.jpg b/newbackend/Zola/albumart/lorde_melodrama_NOX8qVg.jpg similarity index 100% rename from backend/Zola/profilepics/lorde_melodrama.jpg rename to newbackend/Zola/albumart/lorde_melodrama_NOX8qVg.jpg diff --git a/backend/Zola/albumart/maggie_rogers.jpeg b/newbackend/Zola/albumart/maggie_rogers.jpeg similarity index 100% rename from backend/Zola/albumart/maggie_rogers.jpeg rename to newbackend/Zola/albumart/maggie_rogers.jpeg diff --git a/backend/Zola/albumart/marenmorris_6LFrdJM.jpg b/newbackend/Zola/albumart/marenmorris_6LFrdJM.jpg similarity index 100% rename from backend/Zola/albumart/marenmorris_6LFrdJM.jpg rename to newbackend/Zola/albumart/marenmorris_6LFrdJM.jpg diff --git a/backend/Zola/albumart/shield.PNG b/newbackend/Zola/albumart/shield.PNG similarity index 100% rename from backend/Zola/albumart/shield.PNG rename to newbackend/Zola/albumart/shield.PNG diff --git a/backend/Zola/albumart/tame_impala_currents.jpg b/newbackend/Zola/albumart/tame_impala_currents.jpg similarity index 100% rename from backend/Zola/albumart/tame_impala_currents.jpg rename to newbackend/Zola/albumart/tame_impala_currents.jpg diff --git a/backend/Zola/albumart/to_pimp_a_butterfly.jpg b/newbackend/Zola/albumart/to_pimp_a_butterfly.jpg similarity index 100% rename from backend/Zola/albumart/to_pimp_a_butterfly.jpg rename to newbackend/Zola/albumart/to_pimp_a_butterfly.jpg diff --git a/backend/Zola/albumart/tyler-the-creator-flower-boy-album-cover.jpeg b/newbackend/Zola/albumart/tyler-the-creator-flower-boy-album-cover.jpeg similarity index 100% rename from backend/Zola/albumart/tyler-the-creator-flower-boy-album-cover.jpeg rename to newbackend/Zola/albumart/tyler-the-creator-flower-boy-album-cover.jpeg diff --git a/backend/Zola/manage.py b/newbackend/Zola/manage.py similarity index 100% rename from backend/Zola/manage.py rename to newbackend/Zola/manage.py diff --git a/backend/Zola/profilepics/Screen_Shot_2020-03-23_at_12.58.21_PM.png b/newbackend/Zola/profilepics/Screen_Shot_2020-03-23_at_12.58.21_PM.png similarity index 100% rename from backend/Zola/profilepics/Screen_Shot_2020-03-23_at_12.58.21_PM.png rename to newbackend/Zola/profilepics/Screen_Shot_2020-03-23_at_12.58.21_PM.png diff --git a/backend/Zola/profilepics/Screen_Shot_2020-04-06_at_1.24.21_PM.png b/newbackend/Zola/profilepics/Screen_Shot_2020-04-06_at_1.24.21_PM.png similarity index 100% rename from backend/Zola/profilepics/Screen_Shot_2020-04-06_at_1.24.21_PM.png rename to newbackend/Zola/profilepics/Screen_Shot_2020-04-06_at_1.24.21_PM.png diff --git a/backend/Zola/profilepics/acidrap.jpg b/newbackend/Zola/profilepics/acidrap.jpg similarity index 100% rename from backend/Zola/profilepics/acidrap.jpg rename to newbackend/Zola/profilepics/acidrap.jpg diff --git a/backend/Zola/profilepics/acidrap_Ee2Iv0c.jpg b/newbackend/Zola/profilepics/acidrap_Ee2Iv0c.jpg similarity index 100% rename from backend/Zola/profilepics/acidrap_Ee2Iv0c.jpg rename to newbackend/Zola/profilepics/acidrap_Ee2Iv0c.jpg diff --git a/backend/Zola/profilepics/boniver_new.jpg b/newbackend/Zola/profilepics/boniver_new.jpg similarity index 100% rename from backend/Zola/profilepics/boniver_new.jpg rename to newbackend/Zola/profilepics/boniver_new.jpg diff --git a/backend/Zola/profilepics/boniver_new_D8Cmgyb.jpg b/newbackend/Zola/profilepics/boniver_new_D8Cmgyb.jpg similarity index 100% rename from backend/Zola/profilepics/boniver_new_D8Cmgyb.jpg rename to newbackend/Zola/profilepics/boniver_new_D8Cmgyb.jpg diff --git a/backend/Zola/profilepics/boniver_new_MtSd0WC.jpg b/newbackend/Zola/profilepics/boniver_new_MtSd0WC.jpg similarity index 100% rename from backend/Zola/profilepics/boniver_new_MtSd0WC.jpg rename to newbackend/Zola/profilepics/boniver_new_MtSd0WC.jpg diff --git a/backend/Zola/profilepics/boniver_new_R9x7YkZ.jpg b/newbackend/Zola/profilepics/boniver_new_R9x7YkZ.jpg similarity index 100% rename from backend/Zola/profilepics/boniver_new_R9x7YkZ.jpg rename to newbackend/Zola/profilepics/boniver_new_R9x7YkZ.jpg diff --git a/backend/Zola/profilepics/falcon.PNG b/newbackend/Zola/profilepics/falcon.PNG similarity index 100% rename from backend/Zola/profilepics/falcon.PNG rename to newbackend/Zola/profilepics/falcon.PNG diff --git a/newbackend/Zola/profilepics/harryfinelinealbumcover.jpg b/newbackend/Zola/profilepics/harryfinelinealbumcover.jpg new file mode 100644 index 0000000..525a3e8 Binary files /dev/null and b/newbackend/Zola/profilepics/harryfinelinealbumcover.jpg differ diff --git a/newbackend/Zola/profilepics/harryfinelinealbumcover_jxobLMa.jpg b/newbackend/Zola/profilepics/harryfinelinealbumcover_jxobLMa.jpg new file mode 100644 index 0000000..525a3e8 Binary files /dev/null and b/newbackend/Zola/profilepics/harryfinelinealbumcover_jxobLMa.jpg differ diff --git a/backend/Zola/profilepics/lanadeyrey_lustforlife.jpeg b/newbackend/Zola/profilepics/lanadeyrey_lustforlife.jpeg similarity index 100% rename from backend/Zola/profilepics/lanadeyrey_lustforlife.jpeg rename to newbackend/Zola/profilepics/lanadeyrey_lustforlife.jpeg diff --git a/backend/Zola/profilepics/lorde_melodrama_SEt8d0w.jpg b/newbackend/Zola/profilepics/lorde_melodrama.jpg similarity index 100% rename from backend/Zola/profilepics/lorde_melodrama_SEt8d0w.jpg rename to newbackend/Zola/profilepics/lorde_melodrama.jpg diff --git a/newbackend/Zola/profilepics/lorde_melodrama_SEt8d0w.jpg b/newbackend/Zola/profilepics/lorde_melodrama_SEt8d0w.jpg new file mode 100644 index 0000000..df99074 Binary files /dev/null and b/newbackend/Zola/profilepics/lorde_melodrama_SEt8d0w.jpg differ diff --git a/backend/Zola/profilepics/sza-ctrl-album-cover.jpeg b/newbackend/Zola/profilepics/sza-ctrl-album-cover.jpeg similarity index 100% rename from backend/Zola/profilepics/sza-ctrl-album-cover.jpeg rename to newbackend/Zola/profilepics/sza-ctrl-album-cover.jpeg diff --git a/backend/Zola/profilepics/sza-ctrl-album-cover_5fLvP1g.jpeg b/newbackend/Zola/profilepics/sza-ctrl-album-cover_5fLvP1g.jpeg similarity index 100% rename from backend/Zola/profilepics/sza-ctrl-album-cover_5fLvP1g.jpeg rename to newbackend/Zola/profilepics/sza-ctrl-album-cover_5fLvP1g.jpeg diff --git a/backend/Zola/profilepics/tyler-the-creator-flower-boy-album-cover.jpeg b/newbackend/Zola/profilepics/tyler-the-creator-flower-boy-album-cover.jpeg similarity index 100% rename from backend/Zola/profilepics/tyler-the-creator-flower-boy-album-cover.jpeg rename to newbackend/Zola/profilepics/tyler-the-creator-flower-boy-album-cover.jpeg diff --git a/backend/Zola/profilepics/wardrak.PNG b/newbackend/Zola/profilepics/wardrak.PNG similarity index 100% rename from backend/Zola/profilepics/wardrak.PNG rename to newbackend/Zola/profilepics/wardrak.PNG diff --git a/backend/Zola/requirements.txt b/newbackend/Zola/requirements.txt similarity index 90% rename from backend/Zola/requirements.txt rename to newbackend/Zola/requirements.txt index c0cbc38..4576755 100644 --- a/backend/Zola/requirements.txt +++ b/newbackend/Zola/requirements.txt @@ -6,4 +6,4 @@ django-rest-auth django-cors-headers channels channels_redis -django.tesst +django.test diff --git a/backend/Zola/vueapi/__init__.py b/newbackend/Zola/vueapi/__init__.py similarity index 100% rename from backend/Zola/vueapi/__init__.py rename to newbackend/Zola/vueapi/__init__.py diff --git a/backend/Zola/vueapi/adapter.py b/newbackend/Zola/vueapi/adapter.py similarity index 100% rename from backend/Zola/vueapi/adapter.py rename to newbackend/Zola/vueapi/adapter.py diff --git a/backend/Zola/vueapi/admin.py b/newbackend/Zola/vueapi/admin.py similarity index 100% rename from backend/Zola/vueapi/admin.py rename to newbackend/Zola/vueapi/admin.py diff --git a/backend/Zola/vueapi/api_paths.txt b/newbackend/Zola/vueapi/api_paths.txt similarity index 100% rename from backend/Zola/vueapi/api_paths.txt rename to newbackend/Zola/vueapi/api_paths.txt diff --git a/backend/Zola/vueapi/apps.py b/newbackend/Zola/vueapi/apps.py similarity index 100% rename from backend/Zola/vueapi/apps.py rename to newbackend/Zola/vueapi/apps.py diff --git a/backend/Zola/vueapi/consumers.py b/newbackend/Zola/vueapi/consumers.py similarity index 100% rename from backend/Zola/vueapi/consumers.py rename to newbackend/Zola/vueapi/consumers.py diff --git a/backend/Zola/vueapi/forms.py b/newbackend/Zola/vueapi/forms.py similarity index 100% rename from backend/Zola/vueapi/forms.py rename to newbackend/Zola/vueapi/forms.py diff --git a/backend/Zola/vueapi/migrations/0001_initial.py b/newbackend/Zola/vueapi/migrations/0001_initial.py similarity index 100% rename from backend/Zola/vueapi/migrations/0001_initial.py rename to newbackend/Zola/vueapi/migrations/0001_initial.py diff --git a/backend/Zola/vueapi/migrations/0002_auto_20200414_2018.py b/newbackend/Zola/vueapi/migrations/0002_auto_20200414_2018.py similarity index 100% rename from backend/Zola/vueapi/migrations/0002_auto_20200414_2018.py rename to newbackend/Zola/vueapi/migrations/0002_auto_20200414_2018.py diff --git a/backend/Zola/vueapi/migrations/0002_auto_20200414_2019.py b/newbackend/Zola/vueapi/migrations/0002_auto_20200414_2019.py similarity index 100% rename from backend/Zola/vueapi/migrations/0002_auto_20200414_2019.py rename to newbackend/Zola/vueapi/migrations/0002_auto_20200414_2019.py diff --git a/backend/Zola/vueapi/migrations/0002_auto_20200415_0219.py b/newbackend/Zola/vueapi/migrations/0002_auto_20200415_0219.py similarity index 100% rename from backend/Zola/vueapi/migrations/0002_auto_20200415_0219.py rename to newbackend/Zola/vueapi/migrations/0002_auto_20200415_0219.py diff --git a/backend/Zola/vueapi/migrations/0003_merge_20200415_1546.py b/newbackend/Zola/vueapi/migrations/0003_merge_20200415_1546.py similarity index 100% rename from backend/Zola/vueapi/migrations/0003_merge_20200415_1546.py rename to newbackend/Zola/vueapi/migrations/0003_merge_20200415_1546.py diff --git a/backend/Zola/vueapi/migrations/0004_merge_20200418_2358.py b/newbackend/Zola/vueapi/migrations/0004_merge_20200418_2358.py similarity index 100% rename from backend/Zola/vueapi/migrations/0004_merge_20200418_2358.py rename to newbackend/Zola/vueapi/migrations/0004_merge_20200418_2358.py diff --git a/backend/Zola/vueapi/migrations/0005_message.py b/newbackend/Zola/vueapi/migrations/0005_message.py similarity index 100% rename from backend/Zola/vueapi/migrations/0005_message.py rename to newbackend/Zola/vueapi/migrations/0005_message.py diff --git a/backend/Zola/vueapi/migrations/__init__.py b/newbackend/Zola/vueapi/migrations/__init__.py similarity index 100% rename from backend/Zola/vueapi/migrations/__init__.py rename to newbackend/Zola/vueapi/migrations/__init__.py diff --git a/backend/Zola/vueapi/models.py b/newbackend/Zola/vueapi/models.py similarity index 100% rename from backend/Zola/vueapi/models.py rename to newbackend/Zola/vueapi/models.py diff --git a/backend/Zola/vueapi/serializers.py b/newbackend/Zola/vueapi/serializers.py similarity index 68% rename from backend/Zola/vueapi/serializers.py rename to newbackend/Zola/vueapi/serializers.py index c0861d5..d6c8d0b 100644 --- a/backend/Zola/vueapi/serializers.py +++ b/newbackend/Zola/vueapi/serializers.py @@ -9,8 +9,7 @@ class ProfileSerializer(serializers.ModelSerializer): class Meta: model = Profile - fields = ('username', 'email', 'name', - 'shipping_addr', 'profile_pic', 'id') + fields = ("username", "email", "name", "shipping_addr", "profile_pic", "id") class LoginSerializer(RestAuthLoginSerializer): @@ -24,33 +23,31 @@ class RegisterProfileSerializer(RegisterSerializer): def get_cleaned_data(self): data_dict = super().get_cleaned_data() - data_dict['name'] = self.validated_data.get('name', '') - data_dict['shipping_addr'] = self.validated_data.get( - 'shipping_addr', '') - data_dict['profile_pic'] = self.validated_data.get('profile_pic', '') + data_dict["name"] = self.validated_data.get("name", "") + data_dict["shipping_addr"] = self.validated_data.get("shipping_addr", "") + data_dict["profile_pic"] = self.validated_data.get("profile_pic", "") return data_dict class ItemSerializer(serializers.ModelSerializer): class Meta: model = Item - fields = '__all__' + fields = "__all__" class PaymentSerializer(serializers.ModelSerializer): class Meta: model = Payment - fields = '__all__' + fields = "__all__" class UserSerializer(serializers.ModelSerializer): class Meta: model = Profile - fields = ('username', 'email', 'name', - 'shipping_addr', 'profile_pic', 'id') + fields = ("username", "email", "name", "shipping_addr", "profile_pic", "id") class MessageSerializer(serializers.ModelSerializer): class Meta: model = Message - fields = ['content', 'user', 'date'] + fields = ["id", "content", "user", "date"] diff --git a/newbackend/Zola/vueapi/tests.py b/newbackend/Zola/vueapi/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/newbackend/Zola/vueapi/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/backend/Zola/vueapi/urls.py b/newbackend/Zola/vueapi/urls.py similarity index 100% rename from backend/Zola/vueapi/urls.py rename to newbackend/Zola/vueapi/urls.py diff --git a/backend/Zola/vueapi/views.py b/newbackend/Zola/vueapi/views.py similarity index 100% rename from backend/Zola/vueapi/views.py rename to newbackend/Zola/vueapi/views.py