Wednesday, July 4, 2018

Commit webapp Food Detail: Create functional_test


  • Detail Commit
สร้างไฟล์ functional_tests.py ขึ้นมาเพื่อไว้สำหรับทำการ Test Webapp: Food detail
          โดยที่เราต้องทำการ test เพราะ เราต้องการที่จะรู้ว่า webapp ของเราสามารถทำงานจนได้ผลลัพธ์ได้ครบตรงตาม requirement ไหม โดย มี requirement ดังนี้
  1. ดูอาหารได้ 
  2. เพิ่มอาหารได้
  3. แก้ไขอาหารได้
  4. ลบอาหารได้ 
เมื่อเราทำไฟล์ functional_tests.py เสร็จสิ้นเราจึงได้สร้างโปรเจค Django ขึ้นมาโดยมีชื่อว่า "Food" โดยใช้คำสั่ง
 $ django-admin startproject Food
จากนั้นจึงได้ทำการ .gitignore เพราะ เราจะไม่บันทึกทุกอย่างลง version control เช่น
  •   ไฟล์ของระบบปฏิบัติการ
  •     ไฟล์ที่ build จาก source code
  •     dependencies ที่ดาวโหลดมา
  •     ไฟล์ config ของ IDE: Integrated development environment
  •     properties file หรือ config file ของ production server
ในที่นี้เราจะเว้นไฟล์
  • db.sqlite3 
  •  geckodriver.log 
  • virtualenv
  • .pyc
โดยใช้คำสั่ง
  • $ echo "db.sqlite3" >> .gitignore
  • $ echo "geckodriver.log" >> .gitignore
  • $ echo "virtualenv" >> .gitignore
  • $ git rm -r --cached superlists/__pycache__
  • $ echo "__pycache__" >> .gitignore
  • $ echo "*.pyc" >> .gitignore
  • $ git add .
 แล้วทำการ commit

  •  File : functional_tests.py




No comments:

Post a Comment