Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • startuplab/courses/tjts5901-continuous-software-engineering/TJTS5901-K23_template
  • planet-of-the-apes/tjts-5901-apeuction
  • uunot-yliopiston-leivissa/tjts-5901-uunot
  • contain-the-cry/tjts-5901-auction-system
  • avengers/avengers
  • cse6/cse-6
  • 13th/13-sins-of-gitlab
  • fast-and-furious/fast-and-furious
  • back-to-the-future/delorean-auction
  • monty-pythons-the-meaning-of-life/the-meaning-of-life
  • team-atlantis/the-empire
  • code-with-the-wind/auction-project
  • the-pirates/the-pirates
  • do-the-right-thing/do-the-right-thing
  • inception/inception
  • the-social-network-syndicate/the-social-auction-network
  • team-the-hunt-for-red-october/tjts-5901-k-23-red-october
  • good-on-paper/good-paper-project
  • desperados/desperados
19 results
Show changes
Commits on Source (13)
Showing
with 1372 additions and 13 deletions
...@@ -27,7 +27,9 @@ Radek: ...@@ -27,7 +27,9 @@ Radek:
- Pressed few keys that resulted in writing something on the final report - Pressed few keys that resulted in writing something on the final report
Olli: Olli:
- - Additional localisation/improve previous ones
- Added badges on gitlab
- Preparation of final report/presentation
Aapo: Aapo:
- Resloved the bug issues: - Resloved the bug issues:
......
...@@ -139,7 +139,7 @@ class Item: ...@@ -139,7 +139,7 @@ class Item:
def send_mail(self): def send_mail(self):
pass pass
def delete_item(self, id, user) -> bool: def delete_item(self, id, user_mail) -> bool:
"""Delets item with given id, only if the user is admin or item is owned ny user. """Delets item with given id, only if the user is admin or item is owned ny user.
Args: Args:
...@@ -149,13 +149,15 @@ class Item: ...@@ -149,13 +149,15 @@ class Item:
Returns: Returns:
bool: if user has privileges to delete item true, else false bool: if user has privileges to delete item true, else false
""" """
user = self.users.find_one({"email" : user}) user= self.users.find_one({"email" : user_mail})
if user["admin"]: user_is_admin = user['admin']
#print(f"\n user {user_is_admin}\n")
if user_is_admin is True:
logger.info("Admin is deleting item") logger.info("Admin is deleting item")
self.items.delete_one({"_id" : ObjectId(id)}) self.items.delete_one({"_id" : ObjectId(id)})
return True return True
item = self.items.find_one({"_id" : ObjectId(id), "owned_by" : user}) item = self.items.find_one({"_id" : ObjectId(id), "owned_by" : user['email']})
if not item: if not item:
return False return False
self.items.delete_one({"_id" : ObjectId(id)}) self.items.delete_one({"_id" : ObjectId(id)})
......
...@@ -87,6 +87,23 @@ class User: ...@@ -87,6 +87,23 @@ class User:
user = self.users.find_one({"email" : email}) user = self.users.find_one({"email" : email})
return user["admin"] return user["admin"]
def delete_user(self, user_email) -> bool:
"""Delets user with given username.
Args:
id (_type_): id of the item
user (_type_): current user
Returns:
bool: if exists and was deleted return true, else false
"""
user = self.users.find_one({"email" : user_email})
if not user:
return False
self.users.delete_one({"email" : user_email})
return True
def serialize(self): def serialize(self):
#information hiding #information hiding
serialized : dict = {"email" : self.email} serialized : dict = {"email" : self.email}
......
<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-cz" viewBox="0 0 640 480">
<path fill="#fff" d="M0 0h640v240H0z"/>
<path fill="#d7141a" d="M0 240h640v240H0z"/>
<path fill="#11457e" d="M360 240 0 0v480z"/>
</svg>
src/tjts5901/frontend/styles/img/en_GB.png

9.91 KiB

<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-gb" viewBox="0 0 640 480">
<path fill="#012169" d="M0 0h640v480H0z"/>
<path fill="#FFF" d="m75 0 244 181L562 0h78v62L400 241l240 178v61h-80L320 301 81 480H0v-60l239-178L0 64V0h75z"/>
<path fill="#C8102E" d="m424 281 216 159v40L369 281h55zm-184 20 6 35L54 480H0l240-179zM640 0v3L391 191l2-44L590 0h50zM0 0l239 176h-60L0 42V0z"/>
<path fill="#FFF" d="M241 0v480h160V0H241zM0 160v160h640V160H0z"/>
<path fill="#C8102E" d="M0 193v96h640v-96H0zM273 0v480h96V0h-96z"/>
</svg>
src/tjts5901/frontend/styles/img/fi_FI.png

5.77 KiB

<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-fi" viewBox="0 0 640 480">
<path fill="#fff" d="M0 0h640v480H0z"/>
<path fill="#002f6c" d="M0 174.5h640v131H0z"/>
<path fill="#002f6c" d="M175.5 0h130.9v480h-131z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-jp" viewBox="0 0 640 480">
<defs>
<clipPath id="a">
<path fill-opacity=".7" d="M-88 32h640v480H-88z"/>
</clipPath>
</defs>
<g fill-rule="evenodd" stroke-width="1pt" clip-path="url(#a)" transform="translate(88 -32)">
<path fill="#fff" d="M-128 32h720v480h-720z"/>
<circle cx="523.1" cy="344.1" r="194.9" fill="#bc002d" transform="translate(-168.4 8.6) scale(.76554)"/>
</g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-sk" viewBox="0 0 640 480">
<path fill="#ee1c25" d="M0 0h640v480H0z"/>
<path fill="#0b4ea2" d="M0 0h640v320H0z"/>
<path fill="#fff" d="M0 0h640v160H0z"/>
<path fill="#fff" d="M233 370.8c-43-20.7-104.6-61.9-104.6-143.2 0-81.4 4-118.4 4-118.4h201.3s3.9 37 3.9 118.4S276 350 233 370.8z"/>
<path fill="#ee1c25" d="M233 360c-39.5-19-96-56.8-96-131.4s3.6-108.6 3.6-108.6h184.8s3.5 34 3.5 108.6C329 303.3 272.5 341 233 360z"/>
<path fill="#fff" d="M241.4 209c10.7.2 31.6.6 50.1-5.6 0 0-.4 6.7-.4 14.4s.5 14.4.5 14.4c-17-5.7-38.1-5.8-50.2-5.7v41.2h-16.8v-41.2c-12-.1-33.1 0-50.1 5.7 0 0 .5-6.7.5-14.4 0-7.8-.5-14.4-.5-14.4 18.5 6.2 39.4 5.8 50 5.6v-25.9c-9.7 0-23.7.4-39.6 5.7 0 0 .5-6.6.5-14.4 0-7.7-.5-14.4-.5-14.4 15.9 5.3 29.9 5.8 39.6 5.7-.5-16.4-5.3-37-5.3-37s9.9.7 13.8.7c4 0 13.8-.7 13.8-.7s-4.8 20.6-5.3 37c9.7.1 23.7-.4 39.6-5.7 0 0-.5 6.7-.5 14.4 0 7.8.5 14.4.5 14.4a119 119 0 0 0-39.7-5.7v26z"/>
<path fill="#0b4ea2" d="M233 263.3c-19.9 0-30.5 27.5-30.5 27.5s-6-13-22.2-13c-11 0-19 9.7-24.2 18.8 20 31.7 51.9 51.3 76.9 63.4 25-12 57-31.7 76.9-63.4-5.2-9-13.2-18.8-24.2-18.8-16.2 0-22.2 13-22.2 13S253 263.3 233 263.3z"/>
</svg>
src/tjts5901/frontend/styles/img/sv_SE.png

6.34 KiB

<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-se" viewBox="0 0 640 480">
<path fill="#005293" d="M0 0h640v480H0z"/>
<path fill="#fecb00" d="M176 0v192H0v96h176v192h96V288h368v-96H272V0h-96z"/>
</svg>
...@@ -110,15 +110,23 @@ li > div:nth-child(1) { ...@@ -110,15 +110,23 @@ li > div:nth-child(1) {
} }
#locale-selector a[href$="locale=en_GB"] { #locale-selector a[href$="locale=en_GB"] {
background-image: url('img/en_GB.png'); background-image: url('img/en_GB.svg');
} }
#locale-selector a[href$="locale=fi_FI"] { #locale-selector a[href$="locale=fi_FI"] {
background-image: url('img/fi_FI.png'); background-image: url('img/fi_FI.svg');
} }
#locale-selector a[href$="locale=sv_SE"] { #locale-selector a[href$="locale=sv_SE"] {
background-image: url('img/sv_SE.png'); background-image: url('img/sv_SE.svg');
}
#locale-selector a[href$="locale=cs_CZ"] {
background-image: url('img/cs_CZ.svg');
}
#locale-selector a[href$="locale=ja_JP"] {
background-image: url('img/ja_JP.svg');
}
#locale-selector a[href$="locale=sk_SK"] {
background-image: url('img/sk_SK.svg');
} }
h1 { h1 {
text-align: center; text-align: center;
......
...@@ -36,7 +36,16 @@ class SupportedLocales(Enum): ...@@ -36,7 +36,16 @@ class SupportedLocales(Enum):
EN = "en_GB.UTF-8" EN = "en_GB.UTF-8"
"English (United Kingdom)" "English (United Kingdom)"
JA = "ja_JP.UTF-8"
"Japanese (Japan)"
CZ = "cs_CZ.UTF-8"
"Czech (Czech Republic)"
SK = "sk_SK.UTF-8"
"Slovak (Slovakia)"
# EN_US = "en_US.UTF-8" # EN_US = "en_US.UTF-8"
# "English (United States)" # "English (United States)"
......
# Czech (Česká Republika) translations for PROJECT.
# Copyright (C) 2023 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2023-02-16 14:25+0000\n"
"PO-Revision-Date: 2023-02-14 13:17+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: cz_CZ\n"
"Language-Team: cz_CZ <LL@li.org>\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.11.0\n"
#: src/tjts5901/app.py:77
msgid "13th auction app"
msgstr "13th aukciová aplikáce"
#: src/tjts5901/app.py:111 tests/test_i18n.py:77 tests/test_i18n.py:100
msgid "Hello, World!"
msgstr "Ahoj Svět!"
#: src/tjts5901/auth.py:57
msgid "Username is required."
msgstr "Používateľskí jméno je povinný."
#: src/tjts5901/auth.py:59
msgid "Password is required."
msgstr "Heslo je povinný"
#: src/tjts5901/auth.py:61
msgid "Passwords do not match."
msgstr "Heslo alebo email se nezhodují."
#: src/tjts5901/auth.py:63
msgid "You must agree to the terms."
msgstr "Suhlas s podmínkami používaní je nutný"
#: src/tjts5901/auth.py:72
msgid "You have been registered. Please log in."
msgstr "Bili ste úspešne zaregistrovaný. Teraz se prihláste"
#: src/tjts5901/auth.py:95 src/tjts5901/auth.py:98
msgid "Incorrect username."
msgstr "Nesprávne používateľské jméno."
#: src/tjts5901/auth.py:100
msgid "Incorrect password."
msgstr "Nesprávne heslo."
#: src/tjts5901/auth.py:116
msgid "You have been logged out."
msgstr "Bili ste odhlásený."
#: src/tjts5901/items.py:59 src/tjts5901/items.py:96
msgid "Title is required."
msgstr "Název produktu je povinný."
#: src/tjts5901/items.py:61
msgid "Starting bid must be greater than 0."
msgstr "Prvotný cena vášho predmetu musí byť väčší ako 0."
#: src/tjts5901/items.py:105
msgid "Item updated successfully!"
msgstr "Váš predmet bol úspešne aktualizovaný!"
#: src/tjts5901/items.py:125
msgid "Item deleted successfully!"
msgstr "Váš predmet bol úspešne vymazán!"
#: src/tjts5901/templates/auction.html:24
msgid "For sale: "
msgstr "Na prodaj: "
#: src/tjts5901/templates/auction.html:26
msgid "Auction closes in:"
msgstr "Aukcia sa uzavře za: "
#: src/tjts5901/templates/auction.html:32
msgid "Category: "
msgstr "Kategória: "
#: src/tjts5901/templates/auction.html:36
msgid "Subcategory"
msgstr "Subkategória: "
#: src/tjts5901/templates/auction.html:40
msgid "Initial price: "
msgstr "Prvotný cena: "
#: src/tjts5901/templates/auction.html:45
#, fuzzy
msgid "Description: "
msgstr "Popis: "
#: src/tjts5901/templates/auction.html:61
msgid "Owner: "
msgstr "Majiteľ: "
#: src/tjts5901/templates/auction.html:61
msgid "Owner data maybe here"
msgstr "Majiteľové dáta budou tu, možná..."
#: src/tjts5901/templates/auction.html:64
msgid "Share on social media:"
msgstr "Zdíľejte na socialných médiach:"
#: src/tjts5901/templates/auction.html:69
msgid "Bids:"
msgstr "Aukčné ponuky:"
#: src/tjts5901/templates/auction.html:71
msgid "Current top bid: "
msgstr "Najvyšša ponuka: "
#: src/tjts5901/templates/auction.html:74
msgid "Latest bid: "
msgstr "Aktuálna ponuka: "
#: src/tjts5901/templates/auction.html:75
msgid "maybe later bids and their data visible."
msgstr "Možno v budúcnosti tu budú ponuky a ich dáta."
#: src/tjts5901/templates/auction.html:81
msgid "Make a bid: "
msgstr "Vytvorte ponuku: "
#: src/tjts5901/templates/auction.html:83
msgid "Bid!"
msgstr "Ponúknuť!"
#: src/tjts5901/templates/auction.html:94
msgid "Twitter"
msgstr "Twitter"
#: src/tjts5901/templates/auction.html:98
msgid "Facebook"
msgstr "Facebook"
#: src/tjts5901/templates/auction.html:102
msgid "Email to friend"
msgstr "Email kamarátovi"
#: src/tjts5901/templates/base.html:53
msgid "Home"
msgstr "Domov"
#: src/tjts5901/templates/base.html:56
msgid "Sell"
msgstr "Predaj"
#: src/tjts5901/templates/base.html:59
msgid "About"
msgstr "O nás"
#: src/tjts5901/templates/base.html:65
msgid "Log Out"
msgstr "Odhlásiť"
#: src/tjts5901/templates/base.html:67
msgid "Register"
msgstr "Registrovať"
#: src/tjts5901/templates/base.html:68
msgid "Log In"
msgstr "Prihlásenie"
#: src/tjts5901/templates/base.html:72 src/tjts5901/templates/base.html:73
msgid "Search"
msgstr "Hľadať"
#: src/tjts5901/templates/base.html:78
msgid "Language"
msgstr "Jazyk"
#: src/tjts5901/templates/index.html.j2:30
msgid "My Items"
msgstr "Moje predmety"
#: src/tjts5901/templates/index.html.j2:34
msgid "Here's a form to add a new auction."
msgstr "Formulář na pridanie novej aukcii."
#: src/tjts5901/templates/index.html.j2:40
#, fuzzy
msgid "Title:"
msgstr "Názov:"
#: src/tjts5901/templates/index.html.j2:44
#, fuzzy
msgid "Choose category:"
msgstr "Vyberte kategóriu:"
#: src/tjts5901/templates/index.html.j2:48
#, fuzzy
msgid "Choose subcategory:"
msgstr "Vyberte Subkategóriu:"
#: src/tjts5901/templates/index.html.j2:54
#, fuzzy
msgid "Starting price:"
msgstr "Začiatoční cenna:"
#: src/tjts5901/templates/index.html.j2:57
msgid "Currency:"
msgstr "Mena:"
#: src/tjts5901/templates/index.html.j2:64
msgid "Available in:"
msgstr "Dostupní do:"
#: src/tjts5901/templates/index.html.j2:70
#, fuzzy
msgid "Description:"
msgstr "Popis:"
#: src/tjts5901/templates/index.html.j2:73
#, fuzzy
msgid "Start auction"
msgstr "Vytvorte aukci"
#: src/tjts5901/templates/index.html.j2:81
msgid "Here is listing of my own items and bids and ways to edit them."
msgstr "List vašich aukcí a možnosť ich upravenia."
#: src/tjts5901/templates/index.html.j2:89
msgid "Here is a list of my old items."
msgstr "List vašich predchádzajúcich aukcí."
#: src/tjts5901/templates/index.html.j2:102
#, fuzzy
msgid "My account"
msgstr "Múj účet"
#: src/tjts5901/templates/index.html.j2:104
msgid "Here's info on the user account."
msgstr "Legendárne informaáicie o vašom účte."
#: src/tjts5901/templates/index.html.j2:110
msgid "Open auctions"
msgstr "Prebiehajúci aukce"
#: src/tjts5901/templates/index.html.j2:116
msgid "Here's is listing of all(?) on going auctions."
msgstr "List všekých prebiehajúcich aukcí.
#: src/tjts5901/templates/index.html.j2:125
msgid "Press this if you feel like it"
msgstr "Zmáčkni ma ak sa na to cítite"
#: src/tjts5901/templates/index.html.j2:128
msgid " I hope clicking helped. Have a nice day"
msgstr "Wow, vy ste to zmáčkli! Prajem prípmený deň."
#: src/tjts5901/templates/auth/login.html:32
#: src/tjts5901/templates/auth/register.html:13
#: src/tjts5901/templates/login.html:16
msgid "Email"
msgstr "Email"
#: src/tjts5901/templates/auth/login.html:33
#: src/tjts5901/templates/auth/register.html:14
#: src/tjts5901/templates/login.html:17
msgid "Your email"
msgstr "Váš email"
#: src/tjts5901/templates/auth/login.html:40
#: src/tjts5901/templates/auth/register.html:21
#: src/tjts5901/templates/login.html:23
msgid "Password"
msgstr "Heslo"
#: src/tjts5901/templates/login.html:24
msgid "Your Password"
msgstr "Vaše heslo"
#: src/tjts5901/templates/auth/login.html:51
#: src/tjts5901/templates/login.html:33
msgid "Remember me"
msgstr "zapamätaj si me"
#: src/tjts5901/templates/login.html:36
msgid "Lost Password?"
msgstr "Zabudli ste heslo?"
#: src/tjts5901/templates/auth/login.html:57
#: src/tjts5901/templates/login.html:39
msgid "Login"
msgstr "Prihlásenie"
#: src/tjts5901/templates/auth/login.html:4
msgid "Log in"
msgstr "Prihlásenie"
#: src/tjts5901/templates/auth/login.html:25
msgid "Sign in to our platform"
msgstr "Prihlás sa do naši platfromy"
#: src/tjts5901/templates/auth/login.html:41
#: src/tjts5901/templates/auth/register.html:22
msgid "Your password"
msgstr "Vaše heslo"
#: src/tjts5901/templates/auth/login.html:54
msgid "Lost password?"
msgstr "Zabudnuté heslo?"
#: src/tjts5901/templates/auth/login.html:61
msgid "Not registered?"
msgstr "Nie ste registorvaný?"
#: src/tjts5901/templates/auth/login.html:62
msgid "Create an account"
msgstr "Vytvoriť účet"
#: src/tjts5901/templates/auth/register.html:25
#: src/tjts5901/templates/auth/register.html:26
msgid "Confirm password"
msgstr "Potvrďte heslo"
#: src/tjts5901/templates/auth/register.html:36
#, python-format
msgid "I agree to the %(terms)s"
msgstr "súhlasím s %(terms)s"
#: src/tjts5901/templates/auth/register.html:36
msgid "terms and conditions"
msgstr "podmínky používanií"
#: src/tjts5901/templates/auth/register.html:41
msgid "Register account"
msgstr "Vytvoriť účet"
#: src/tjts5901/templates/auth/register.html:45
msgid "Already have an account?"
msgstr "Už máte účet?"
#: src/tjts5901/templates/auth/register.html:46
msgid "Login here"
msgstr "Prihlásiť"
#: src/tjts5901/templates/items/index.html:20
msgid "Items on sale"
msgstr "Preíhajúce aukce"
#: src/tjts5901/templates/items/index.html:31
#: src/tjts5901/templates/items/sell.html:15
#: src/tjts5901/templates/items/update.html:17
msgid "Title"
msgstr "Název"
#: src/tjts5901/templates/items/index.html:32
#: src/tjts5901/templates/items/sell.html:19
#: src/tjts5901/templates/items/update.html:21
msgid "Description"
msgstr "Popis"
#: src/tjts5901/templates/items/index.html:33
msgid "Starting Bid"
msgstr "Začiatočná ponuka"
#: src/tjts5901/templates/items/index.html:34
msgid "Seller"
msgstr "Prodejce"
#: src/tjts5901/templates/items/index.html:35
msgid "Created At"
msgstr "Vytvorené o"
#: src/tjts5901/templates/items/index.html:36
msgid "Closes At"
msgstr "Uzavřeté o"
#: src/tjts5901/templates/items/index.html:45
msgid "Edit"
msgstr "Upravit"
#: src/tjts5901/templates/items/sell.html:4
#: src/tjts5901/templates/items/sell.html:23
msgid "Sell an Item"
msgstr "Prodať predmet"
#: src/tjts5901/templates/items/sell.html:12
msgid "Add Item"
msgstr "Pridať predmet"
#: src/tjts5901/templates/items/sell.html:27
msgid "Add to Listing"
msgstr "Pridať do aukcí"
#: src/tjts5901/templates/items/update.html:12
msgid "Update Item"
msgstr "Aktualiziovať predmet"
#: src/tjts5901/templates/items/update.html:25
msgid "Starting Price"
msgstr "Prvotní cena"
#: src/tjts5901/templates/items/update.html:30
msgid "Update Listing"
msgstr "Aktualizovať list"
#: src/tjts5901/templates/items/update.html:31
msgid "Delete"
msgstr "Zrušiť"
#~ msgid "Both email and password are required!"
#~ msgstr "Meno a heslo sú potrebné!"
# Japanese (Japan) translations for PROJECT.
# Copyright (C) 2023 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2023-02-21 11:49+0000\n"
"PO-Revision-Date: 2023-02-21 11:53+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: ja_JP\n"
"Language-Team: ja_JP <LL@li.org>\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.11.0\n"
#: src/tjts5901/app.py:77
msgid "13th auction app"
msgstr "オークションアプリ"
#: src/tjts5901/app.py:111 tests/test_i18n.py:77 tests/test_i18n.py:100
msgid "Hello, World!"
msgstr "Hello, World!"
#: src/tjts5901/items.py:59 src/tjts5901/items.py:96
msgid "Title is required."
msgstr "タイトルは必須です。"
#: src/tjts5901/items.py:61
msgid "Starting bid must be greater than 0."
msgstr "開始入札は0より大きくなければなりません。"
#: src/tjts5901/items.py:105
msgid "Item updated successfully!"
msgstr "アイテムの更新に成功しました!"
#: src/tjts5901/items.py:125
msgid "Item deleted successfully!"
msgstr "アイテムの削除に成功しました!"
#: src/tjts5901/templates/alogin.html:16
#: src/tjts5901/templates/auth/login.html:32
#: src/tjts5901/templates/auth/register.html:13
#: src/tjts5901/templates/login.html:16
msgid "Email"
msgstr "電子メール"
#: src/tjts5901/templates/alogin.html:17
#: src/tjts5901/templates/auth/login.html:33
#: src/tjts5901/templates/auth/register.html:14
#: src/tjts5901/templates/login.html:17
msgid "Your email"
msgstr "あなたのメール"
#: src/tjts5901/templates/alogin.html:23
#: src/tjts5901/templates/auth/login.html:40
#: src/tjts5901/templates/auth/register.html:21
#: src/tjts5901/templates/login.html:23
msgid "Password"
msgstr "パスワード"
#: src/tjts5901/templates/alogin.html:24 src/tjts5901/templates/login.html:24
msgid "Your Password"
msgstr "あなたのパスワード"
#: src/tjts5901/templates/alogin.html:29
#: src/tjts5901/templates/auth/login.html:57
#: src/tjts5901/templates/login.html:39
msgid "Login"
msgstr "ログイン"
#: src/tjts5901/templates/auction.html:27
msgid "For sale: "
msgstr "販売中です:"
#: src/tjts5901/templates/auction.html:29
msgid "Auction closes in:"
msgstr "オークションの終了時間:"
#: src/tjts5901/templates/auction.html:35
msgid "Category: "
msgstr "カテゴリ:"
#: src/tjts5901/templates/auction.html:39
msgid "Subcategory"
msgstr "サブカテゴリ:"
#: src/tjts5901/templates/auction.html:43
msgid "Initial price: "
msgstr "初期価格です:"
#: src/tjts5901/templates/auction.html:48
msgid "Description: "
msgstr "説明文:"
#: src/tjts5901/templates/auction.html:64
msgid "Owner: "
msgstr "所有者: "
#: src/tjts5901/templates/auction.html:71
msgid "Bids:"
msgstr "入札:"
#: src/tjts5901/templates/auction.html:73
msgid "Current top bid: "
msgstr "現在の最高入札価格です:"
#: src/tjts5901/templates/auction.html:76
msgid "Latest bid: "
msgstr "最新の入札額です:"
#: src/tjts5901/templates/auction.html:84
msgid "Make a bid: "
msgstr "入札してください:"
#: src/tjts5901/templates/auction.html:88
msgid "Bid!"
msgstr "入札してください!"
#: src/tjts5901/templates/auction.html:103
msgid "Share on social media:"
msgstr "ソーシャルメディアで共有:"
#: src/tjts5901/templates/auction.html:109
msgid "Twitter"
msgstr "ツイッター"
#: src/tjts5901/templates/auction.html:113
msgid "Facebook"
msgstr "フェイスブック"
#: src/tjts5901/templates/auction.html:117
msgid "Email to friend"
msgstr "友達にメールする"
#: src/tjts5901/templates/base.html:53
msgid "Home"
msgstr "ホーム"
#: src/tjts5901/templates/base.html:56
msgid "Sell"
msgstr "売る"
#: src/tjts5901/templates/base.html:59
msgid "About"
msgstr "バージョン情報"
#: src/tjts5901/templates/base.html:65
msgid "Log Out"
msgstr "ログアウト"
#: src/tjts5901/templates/base.html:67
msgid "Register"
msgstr "登録"
#: src/tjts5901/templates/base.html:68
msgid "Log In"
msgstr "ログイン"
#: src/tjts5901/templates/base.html:75 src/tjts5901/templates/index.html.j2:58
msgid "Currency:"
msgstr "通貨:"
#: src/tjts5901/templates/base.html:81 src/tjts5901/templates/base.html:82
msgid "Search"
msgstr "検索:"
#: src/tjts5901/templates/base.html:88
msgid "Language"
msgstr "検索"
#: src/tjts5901/templates/base.html:95
msgid "EUR"
msgstr "ユーロ"
#: src/tjts5901/templates/index.html.j2:30
msgid "My Items"
msgstr "マイアイテム"
#: src/tjts5901/templates/index.html.j2:34
msgid "Here's a form to add a new auction."
msgstr "新しいオークションを追加するフォームはこちらです。"
#: src/tjts5901/templates/index.html.j2:40
msgid "Title:"
msgstr "タイトル"
#: src/tjts5901/templates/index.html.j2:44
msgid "Choose category:"
msgstr "カテゴリを選択してください:"
#: src/tjts5901/templates/index.html.j2:48
msgid "Choose subcategory:"
msgstr "サブカテゴリを選択してください:"
#: src/tjts5901/templates/index.html.j2:54
msgid "Starting price:"
msgstr "開始価格:"
#: src/tjts5901/templates/index.html.j2:65
msgid "Available in:"
msgstr "利用可能な地域:"
#: src/tjts5901/templates/index.html.j2:71
msgid "Description:"
msgstr "説明:"
#: src/tjts5901/templates/index.html.j2:74
msgid "Start auction"
msgstr "オークション開始"
#: src/tjts5901/templates/index.html.j2:82
msgid "Here is listing of my own items and bids and ways to edit them."
msgstr "自分の出品物や入札の一覧とその編集方法です。"
#: src/tjts5901/templates/index.html.j2:90
msgid "Here is a list of my old items."
msgstr "これは私の古いアイテムのリストです。"
#: src/tjts5901/templates/index.html.j2:103
msgid "My account"
msgstr "私のアカウント"
#: src/tjts5901/templates/index.html.j2:105
msgid "Here's info on the user account."
msgstr "ユーザアカウントの情報です。"
#: src/tjts5901/templates/index.html.j2:111
msgid "Open auctions"
msgstr "オークションを開く"
#: src/tjts5901/templates/index.html.j2:117
msgid "Here's is listing of all(?) on going auctions."
msgstr "開催中の全てのオークションの一覧です。"
#: src/tjts5901/templates/index.html.j2:126
msgid "Press this if you feel like it"
msgstr "気が向いたらこれを押してください"
#: src/tjts5901/templates/index.html.j2:129
msgid "I hope clicking helped. Have a nice day"
msgstr "クリックがお役に立てれば幸いです。良い一日を"
#: src/tjts5901/templates/auth/login.html:51
#: src/tjts5901/templates/login.html:33
msgid "Remember me"
msgstr "私を記憶してください"
#: src/tjts5901/templates/login.html:36
msgid "Lost Password?"
msgstr "パスワードを忘れました?"
#: src/tjts5901/templates/auth/login.html:4
msgid "Log in"
msgstr "ログイン"
#: src/tjts5901/templates/auth/login.html:25
msgid "Sign in to our platform"
msgstr "私たちのプラットフォームへサインインしてください"
#: src/tjts5901/templates/auth/login.html:41
#: src/tjts5901/templates/auth/register.html:22
msgid "Your password"
msgstr "あなたのパスワード"
#: src/tjts5901/templates/auth/login.html:54
msgid "Lost password?"
msgstr "パスワードを紛失しましたか?"
#: src/tjts5901/templates/auth/login.html:61
msgid "Not registered?"
msgstr "未登録ですか?"
#: src/tjts5901/templates/auth/login.html:62
msgid "Create an account"
msgstr "アカウントを作成する"
#: src/tjts5901/templates/auth/register.html:25
#: src/tjts5901/templates/auth/register.html:26
msgid "Confirm password"
msgstr "パスワードの確認"
#: src/tjts5901/templates/auth/register.html:36
#, python-format
msgid "I agree to the %(terms)s"
msgstr "私は%(条件)に同意しま"
#: src/tjts5901/templates/auth/register.html:36
msgid "terms and conditions"
msgstr "利用規約"
#: src/tjts5901/templates/auth/register.html:41
msgid "Register account"
msgstr "アカウント登録"
#: src/tjts5901/templates/auth/register.html:45
msgid "Already have an account?"
msgstr "すでにアカウントを持っていますか?"
#: src/tjts5901/templates/auth/register.html:46
msgid "Login here"
msgstr "ここでログインしてください"
#: src/tjts5901/templates/items/index.html:20
msgid "Items on sale"
msgstr "販売中のアイテム"
#: src/tjts5901/templates/items/index.html:31
#: src/tjts5901/templates/items/sell.html:15
#: src/tjts5901/templates/items/update.html:17
msgid "Title"
msgstr "タイトル"
#: src/tjts5901/templates/items/index.html:32
#: src/tjts5901/templates/items/sell.html:19
#: src/tjts5901/templates/items/update.html:21
msgid "Description"
msgstr "説明"
#: src/tjts5901/templates/items/index.html:33
msgid "Starting Bid"
msgstr "入札開始"
#: src/tjts5901/templates/items/index.html:34
msgid "Seller"
msgstr "出品者"
#: src/tjts5901/templates/items/index.html:35
msgid "Created At"
msgstr "作成日時"
#: src/tjts5901/templates/items/index.html:36
msgid "Closes At"
msgstr "終了日時"
#: src/tjts5901/templates/items/index.html:45
msgid "Edit"
msgstr "編集"
#: src/tjts5901/templates/items/sell.html:4
#: src/tjts5901/templates/items/sell.html:23
msgid "Sell an Item"
msgstr "アイテムを売る"
#: src/tjts5901/templates/items/sell.html:12
msgid "Add Item"
msgstr "アイテムを追加する"
#: src/tjts5901/templates/items/sell.html:27
msgid "Add to Listing"
msgstr "出品に追加"
#: src/tjts5901/templates/items/update.html:12
msgid "Update Item"
msgstr "アイテムを更新します"
#: src/tjts5901/templates/items/update.html:25
msgid "Starting Price"
msgstr "開始価格"
#: src/tjts5901/templates/items/update.html:30
msgid "Update Listing"
msgstr "リストを更新します"
#: src/tjts5901/templates/items/update.html:31
msgid "Delete"
msgstr "削除"
# Slovak (Slovakia) translations for PROJECT.
# Copyright (C) 2023 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2023-02-16 14:25+0000\n"
"PO-Revision-Date: 2023-02-14 13:17+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: sk_SK\n"
"Language-Team: sk_SK <LL@li.org>\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.11.0\n"
#: src/tjts5901/app.py:77
msgid "13th auction app"
msgstr "13th aukciová aplikácia"
#: src/tjts5901/app.py:111 tests/test_i18n.py:77 tests/test_i18n.py:100
msgid "Hello, World!"
msgstr "Ahoj Svet!"
#: src/tjts5901/auth.py:57
msgid "Username is required."
msgstr "Používateľské meno je povinné."
#: src/tjts5901/auth.py:59
msgid "Password is required."
msgstr "Heslo je povinné"
#: src/tjts5901/auth.py:61
msgid "Passwords do not match."
msgstr "Heslo alebo mail sa nezhodujú."
#: src/tjts5901/auth.py:63
msgid "You must agree to the terms."
msgstr "Súhlas s podmienkami používania je povinný"
#: src/tjts5901/auth.py:72
msgid "You have been registered. Please log in."
msgstr "Boli ste úspešne zaregistrovaný. Teraz sa prihláste"
#: src/tjts5901/auth.py:95 src/tjts5901/auth.py:98
msgid "Incorrect username."
msgstr "Nesprávne používateľské meno."
#: src/tjts5901/auth.py:100
msgid "Incorrect password."
msgstr "Nesprávne heslo."
#: src/tjts5901/auth.py:116
msgid "You have been logged out."
msgstr "Boli ste odhlásený."
#: src/tjts5901/items.py:59 src/tjts5901/items.py:96
msgid "Title is required."
msgstr "Názov produktu je potrebný."
#: src/tjts5901/items.py:61
msgid "Starting bid must be greater than 0."
msgstr "Prvotná cena váško predmetu musí byť väčšia ako 0."
#: src/tjts5901/items.py:105
msgid "Item updated successfully!"
msgstr "Váš predmet bol úspešne aktualizovaný!"
#: src/tjts5901/items.py:125
msgid "Item deleted successfully!"
msgstr "Váš predmet bol úspešne vymazaný!"
#: src/tjts5901/templates/auction.html:24
msgid "For sale: "
msgstr "Na predaj: "
#: src/tjts5901/templates/auction.html:26
msgid "Auction closes in:"
msgstr "Aukcia sa uzavrie za: "
#: src/tjts5901/templates/auction.html:32
msgid "Category: "
msgstr "Kategória: "
#: src/tjts5901/templates/auction.html:36
msgid "Subcategory"
msgstr "Subkategória: "
#: src/tjts5901/templates/auction.html:40
msgid "Initial price: "
msgstr "Prvotná cena: "
#: src/tjts5901/templates/auction.html:45
#, fuzzy
msgid "Description: "
msgstr "Popis: "
#: src/tjts5901/templates/auction.html:61
msgid "Owner: "
msgstr "Majiteľ: "
#: src/tjts5901/templates/auction.html:61
msgid "Owner data maybe here"
msgstr "Majiteľové dáta budú tu, možno"
#: src/tjts5901/templates/auction.html:64
msgid "Share on social media:"
msgstr "Zdieľajte na socialných médiach:"
#: src/tjts5901/templates/auction.html:69
msgid "Bids:"
msgstr "Aukčné ponuky:"
#: src/tjts5901/templates/auction.html:71
msgid "Current top bid: "
msgstr "Najvyššia ponuka: "
#: src/tjts5901/templates/auction.html:74
msgid "Latest bid: "
msgstr "Aktuálna ponuka: "
#: src/tjts5901/templates/auction.html:75
msgid "maybe later bids and their data visible."
msgstr "Možno v budúcnosti tu budú ponuky a ich dáta."
#: src/tjts5901/templates/auction.html:81
msgid "Make a bid: "
msgstr "Vytvorte ponuku: "
#: src/tjts5901/templates/auction.html:83
msgid "Bid!"
msgstr "Ponuka!"
#: src/tjts5901/templates/auction.html:94
msgid "Twitter"
msgstr "Twitter"
#: src/tjts5901/templates/auction.html:98
msgid "Facebook"
msgstr "Facebook"
#: src/tjts5901/templates/auction.html:102
msgid "Email to friend"
msgstr "Email kamarátovi"
#: src/tjts5901/templates/base.html:53
msgid "Home"
msgstr "Domov"
#: src/tjts5901/templates/base.html:56
msgid "Sell"
msgstr "Predaj"
#: src/tjts5901/templates/base.html:59
msgid "About"
msgstr "O nás"
#: src/tjts5901/templates/base.html:65
msgid "Log Out"
msgstr "Odhlásiť"
#: src/tjts5901/templates/base.html:67
msgid "Register"
msgstr "Registrovať"
#: src/tjts5901/templates/base.html:68
msgid "Log In"
msgstr "Prihlásenie"
#: src/tjts5901/templates/base.html:72 src/tjts5901/templates/base.html:73
msgid "Search"
msgstr "Hľadať"
#: src/tjts5901/templates/base.html:78
msgid "Language"
msgstr "Jazyk"
#: src/tjts5901/templates/index.html.j2:30
msgid "My Items"
msgstr "Moje predmety"
#: src/tjts5901/templates/index.html.j2:34
msgid "Here's a form to add a new auction."
msgstr "Formulár na pridanie novej aukcie."
#: src/tjts5901/templates/index.html.j2:40
#, fuzzy
msgid "Title:"
msgstr "Názov:"
#: src/tjts5901/templates/index.html.j2:44
#, fuzzy
msgid "Choose category:"
msgstr "Vyberte kategóriu:"
#: src/tjts5901/templates/index.html.j2:48
#, fuzzy
msgid "Choose subcategory:"
msgstr "Vyberte Subkategóriu:"
#: src/tjts5901/templates/index.html.j2:54
#, fuzzy
msgid "Starting price:"
msgstr "Začiatočná cenna:"
#: src/tjts5901/templates/index.html.j2:57
msgid "Currency:"
msgstr "Mena:"
#: src/tjts5901/templates/index.html.j2:64
msgid "Available in:"
msgstr "Dostupné do:"
#: src/tjts5901/templates/index.html.j2:70
#, fuzzy
msgid "Description:"
msgstr "Popis:"
#: src/tjts5901/templates/index.html.j2:73
#, fuzzy
msgid "Start auction"
msgstr "Vytvorte aukciu"
#: src/tjts5901/templates/index.html.j2:81
msgid "Here is listing of my own items and bids and ways to edit them."
msgstr "List vašich aukcií a spôsob ich upravenia."
#: src/tjts5901/templates/index.html.j2:89
msgid "Here is a list of my old items."
msgstr "List vašich predchádzajúcich aukcií."
#: src/tjts5901/templates/index.html.j2:102
#, fuzzy
msgid "My account"
msgstr "Môj účet"
#: src/tjts5901/templates/index.html.j2:104
msgid "Here's info on the user account."
msgstr "Legendárne informaáicie o vašom účte."
#: src/tjts5901/templates/index.html.j2:110
msgid "Open auctions"
msgstr "Prebiehajúce aukcie"
#: src/tjts5901/templates/index.html.j2:116
msgid "Here's is listing of all(?) on going auctions."
msgstr "List všekých prebiehajúcich aukcií.
#: src/tjts5901/templates/index.html.j2:125
msgid "Press this if you feel like it"
msgstr "Stlačte ma ak sa na to cítite"
#: src/tjts5901/templates/index.html.j2:128
msgid " I hope clicking helped. Have a nice day"
msgstr "Wow, vy ste to spravili! Prajem prípmený deň."
#: src/tjts5901/templates/auth/login.html:32
#: src/tjts5901/templates/auth/register.html:13
#: src/tjts5901/templates/login.html:16
msgid "Email"
msgstr "Email"
#: src/tjts5901/templates/auth/login.html:33
#: src/tjts5901/templates/auth/register.html:14
#: src/tjts5901/templates/login.html:17
msgid "Your email"
msgstr "Váš email"
#: src/tjts5901/templates/auth/login.html:40
#: src/tjts5901/templates/auth/register.html:21
#: src/tjts5901/templates/login.html:23
msgid "Password"
msgstr "Heslo"
#: src/tjts5901/templates/login.html:24
msgid "Your Password"
msgstr "Vaše heslo"
#: src/tjts5901/templates/auth/login.html:51
#: src/tjts5901/templates/login.html:33
msgid "Remember me"
msgstr "zapamätaj si ma"
#: src/tjts5901/templates/login.html:36
msgid "Lost Password?"
msgstr "Zabudli ste heslo?"
#: src/tjts5901/templates/auth/login.html:57
#: src/tjts5901/templates/login.html:39
msgid "Login"
msgstr "Prihlásenie"
#: src/tjts5901/templates/auth/login.html:4
msgid "Log in"
msgstr "Prihlásenie"
#: src/tjts5901/templates/auth/login.html:25
msgid "Sign in to our platform"
msgstr "Prihlás sa do našej platfromy"
#: src/tjts5901/templates/auth/login.html:41
#: src/tjts5901/templates/auth/register.html:22
msgid "Your password"
msgstr "Vaše heslo"
#: src/tjts5901/templates/auth/login.html:54
msgid "Lost password?"
msgstr "Zabudli ste heslo?"
#: src/tjts5901/templates/auth/login.html:61
msgid "Not registered?"
msgstr "Nie ste registorvaný?"
#: src/tjts5901/templates/auth/login.html:62
msgid "Create an account"
msgstr "Vytvoriť účet"
#: src/tjts5901/templates/auth/register.html:25
#: src/tjts5901/templates/auth/register.html:26
msgid "Confirm password"
msgstr "Potvrďte heslo"
#: src/tjts5901/templates/auth/register.html:36
#, python-format
msgid "I agree to the %(terms)s"
msgstr "súhlasím s %(terms)s"
#: src/tjts5901/templates/auth/register.html:36
msgid "terms and conditions"
msgstr "podmienky používania"
#: src/tjts5901/templates/auth/register.html:41
msgid "Register account"
msgstr "Vytvoriť účet"
#: src/tjts5901/templates/auth/register.html:45
msgid "Already have an account?"
msgstr "Už máte účet?"
#: src/tjts5901/templates/auth/register.html:46
msgid "Login here"
msgstr "Prihlásiť"
#: src/tjts5901/templates/items/index.html:20
msgid "Items on sale"
msgstr "Prebiehajúce aukcie"
#: src/tjts5901/templates/items/index.html:31
#: src/tjts5901/templates/items/sell.html:15
#: src/tjts5901/templates/items/update.html:17
msgid "Title"
msgstr "Názov"
#: src/tjts5901/templates/items/index.html:32
#: src/tjts5901/templates/items/sell.html:19
#: src/tjts5901/templates/items/update.html:21
msgid "Description"
msgstr "Popis"
#: src/tjts5901/templates/items/index.html:33
msgid "Starting Bid"
msgstr "Začiatočná ponuka"
#: src/tjts5901/templates/items/index.html:34
msgid "Seller"
msgstr "Predajca"
#: src/tjts5901/templates/items/index.html:35
msgid "Created At"
msgstr "Vytvorené o"
#: src/tjts5901/templates/items/index.html:36
msgid "Closes At"
msgstr "Uzavreté o"
#: src/tjts5901/templates/items/index.html:45
msgid "Edit"
msgstr "Upraviť"
#: src/tjts5901/templates/items/sell.html:4
#: src/tjts5901/templates/items/sell.html:23
msgid "Sell an Item"
msgstr "Predať predmet"
#: src/tjts5901/templates/items/sell.html:12
msgid "Add Item"
msgstr "Pridať predmet"
#: src/tjts5901/templates/items/sell.html:27
msgid "Add to Listing"
msgstr "Pridať do aukcii"
#: src/tjts5901/templates/items/update.html:12
msgid "Update Item"
msgstr "Aktualiziovať predmet"
#: src/tjts5901/templates/items/update.html:25
msgid "Starting Price"
msgstr "Začiatočná cena"
#: src/tjts5901/templates/items/update.html:30
msgid "Update Listing"
msgstr "Aktualizovať list"
#: src/tjts5901/templates/items/update.html:31
msgid "Delete"
msgstr "Zrušiť"
#~ msgid "Both email and password are required!"
#~ msgstr "Meno aj heslo sú potrebné!"
...@@ -83,3 +83,5 @@ def app() -> Flask: ...@@ -83,3 +83,5 @@ def app() -> Flask:
@pytest.fixture @pytest.fixture
def client(app) -> Any: def client(app) -> Any:
return app.test_client() return app.test_client()
#coverage run -m pytest
\ No newline at end of file
...@@ -6,10 +6,60 @@ from tjts5901.backend.models.items import Item ...@@ -6,10 +6,60 @@ from tjts5901.backend.models.items import Item
def test_new_user(): def test_new_user():
item = Item('flask_test', 'testing', 'in flask', '123test', 0.0) item = Item('flask_test', 'testing', 'in flask', '123test', 7.7, "pytest@test.com")
assert item.name == 'flask_test' assert item.name == 'flask_test'
assert item.category == 'testing' assert item.category == 'testing'
assert item.subcategory == 'in flask' assert item.subcategory == 'in flask'
assert item.description == '123test' assert item.description == '123test'
assert item.owned_by == "pytest@test.com"
assert item.starting_price == 7.7
assert item.highest_bid_price == 0.0 assert item.highest_bid_price == 0.0
assert item.highest_bidder == '' assert item.highest_bidder == ''
\ No newline at end of file assert item.is_expired is False
def test_serialize():
item = Item()
assert isinstance(item.serialize(), dict)
'''
def test_db_add():
item = Item('flask_test', 'testing', 'in flask', '123test', 7.7, "pytest@test.com")
item.add()
assert item.owned_by == "pytest@test.com"
def test_get_user_item():
item = Item()
user_item = item.get_user_items("pytest@test.com")
item_from_db = [item_from_db for item_from_db in user_item]
first_item = item_from_db[0]
assert isinstance(item_from_db, list)
assert first_item['name'] == 'flask_test'
assert first_item['category'] == 'testing'
assert first_item['subcategory'] == 'in flask'
assert first_item['description'] == '123test'
assert first_item['starting_price'] == 7.7
assert first_item['owned_by'] == 'pytest@test.com'
def test_bid():
item = Item()
user_item = item.get_user_items("pytest@test.com")
item_from_db = [item_from_db for item_from_db in user_item]
first_item = item_from_db[0]
item.set_bider(first_item["_id"], 10, "pytest@test.com")
assert isinstance(item_from_db, list)
def test_my_bids():
item = Item()
user_item = json.loads(item.get_my_bids("pytest@test.com"))
first_item = user_item['ongoing'][0]
assert isinstance(user_item, dict)
assert first_item['highest_bidder'] == "pytest@test.com"
assert first_item['highest_bid_price'] == 10.0
def test_db_delete():
item = Item()
user_item = item.get_user_items("pytest@test.com")
item_from_db = [item_from_db for item_from_db in user_item]
first_item = item_from_db[0]
delete = item.delete_item(id=first_item['_id'], user_mail="pytest@test.com")
assert delete is True
'''
\ No newline at end of file
...@@ -9,4 +9,30 @@ def test_new_user(): ...@@ -9,4 +9,30 @@ def test_new_user():
user = User('tester@test.com', 'test123') user = User('tester@test.com', 'test123')
assert user.email == 'tester@test.com' assert user.email == 'tester@test.com'
assert user.password == 'test123' assert user.password == 'test123'
assert user.admin is False assert user.admin is False
\ No newline at end of file
def test_db_add():
user = User('pytest0@test.com', 'test123')
user.add()
assert user.email == "pytest0@test.com"
def test_get_all_users():
user = User()
users = user.get_all()
users_from_db = [item_from_db for item_from_db in users]
assert isinstance(users_from_db, list)
def test_is_admin():
user = User()
assert user.is_admin("pytest0@test.com") is False
def test_get_user():
user = User()
recived_user = user.get_user("pytest0@test.com")
assert isinstance(recived_user, dict)
assert recived_user['email'] == "pytest0@test.com"
def test_user_delete():
user = User()
user_deleted = user.delete_user("pytest0@test.com")
assert user_deleted is True
\ No newline at end of file