Understanding and summary of the worm master's work "Web interface development and automation testing ... Python.. "Problem handling (continuous update ...) )

Source: Internet
Author: User

After buying the book at Amazon, after actually reading and personally manipulating each line of code, it also left a comment at the station that met the prevailing insights. There are indeed a lot of confusing places, because a lot of details did not talk about, may be the master of the pest experienced not encountered, I met a lot of small white, but not to be scared back, a good solution and summed up here.

-----------------------------

This book can be said that the worm really spent a lot of effort to do. The master surnamed Hu, just I also surname Hu, but I do not have the Worm division so superior congenital conditions, there is no worm division so broad technical system, and I would like to vomit trough a bit.

This book can be said to be a master of the worm, testing can be involved in the interface, performance, security areas, and can be completed by automated processing, has been invaluable. But the entire article about to turn over, testing tools, technology and not detailed, this book is for a certain script language based on the design of people, those who are not able to go into the entry of the people who are skilled to see this and appear superfluous. And this book a lot of tools mentioned also simply wrote one or two page operation introduction, but always talk about not exhaustive, point to jump down to say next. In general, this book is only the name of the Bookworm's business card, printed on it, I will xx tools, in the coding ability to have a decent attainments can even out of the book. So the book buyers need to be cautious. You can read Mr. Liaoche's "Python3" free tutorial, and then consider buying the book.

Next comes the question of the learning process,"points not mentioned in the book, which can also be added as a supplement | | The following only applies to the second printed edition of 2017 "


1, pip installation Download error problem (forced reload)

After installing Python, the issue of the built-in PIP library, because my installation package ' Python-3.6.3-amd64.exe ' inside Pip is the latest, but dead and alive also can not use, more
New can not update, because is the latest, finally find a way to force reinstall to the latest: python-m pip install--upgrade--force-
Reinstall PIP
2, use Python3, but local also have Python2

Proficiency in the use of Python2, the installation of Python3 co-existence problem, I used to now feel that the difference is not big, so or discard the python2, after all, the real difference
Don't go to a certain depth is not necessary to understand, or use the book as Standard (Python3), so as not to use the process of various problems.
2-1. Cloning GitHub source code after the use of the problem

The most critical point, note the indentation, regardless of whether it is copied from the copy or local code file on the page, you should pay attention to indentation. Give us a little trick, all inquiries.
Wrong line and near line code, see the front byte display (here sublime can see the previous points, or a few bars)
3, execute the Code command problem (if the command is Python3 ' project ' Runserver, need to change the EXE name)

Python3 install after the completion of the replacement of the local EXE name problem, in order to be the same as this book, or to the installation directory, the Python.exe replaced Python3.exe
4, add Chinese error code (can only be added at the top)

Want to add comments in the code, as long as you want to annotate, be sure to add a line at the top "#-*-Coding:utf8-*-", so that the code file is executed
No error.
4-1. After downloading the bootstrap package, you need to install it again. Python3\lib\site-packages

After downloading the bootstrap is not able to use directly, need to execute setup.py, here the author is through the cmd into the download directory (direct e: Into the e directory, dir check
Look at the catalogue), Python3 setup.py to install the library into Python3, not mentioned in the book.
4-2, double underline the description, and double equals number and so on

79th page no single underline and double underline are described: name__contains here is a double underline
4-3, the source of cloning should be noted

Page 80th, guest_manage.html, I copy the source code from GitHub, but the code is not pure, there is "<!--{% Endblock%}--
", in the HTML template easily error, I deleted all of them, other friends can also delete the try."
5. Be familiar with URL paths

The 88th page. The only modification of the HTML is to show the "Check in" field, but it does not tell us that the Admin object is not under the position, but under the index path--Tangled
It took three days to find out
6, remember to call the decorated HTML file in Riga reference

89th page, HTML does not have HTML and head, body and other tags, the most important thing is not to remind us to load BOOTSTRAP3 Library
7, the introduction of storage to be accurate

91st page, views.py header import library does not remind must be from sign.models import * (previously only import event)
8, multi-open cmd operation

Execute Python3 manage.py runserver and Python3 manage.py shell, etc., without informing us that we can open a different cmd
9. Create and use names should be consistent

107th page, the method name is wrong, should be ' test_event_manage_success ', ' test_event_manage_search_success ', 108 page same
The error
10. Error handling after non-redirect execution

106th page, and no redirect, response.status_code=302 should be ' = 200 '
11. Cloning Code indentation (reference 2-1)

From github to download the source part has indentation problem, a bunch of indentation is not resolved, need a knock good.

12. Note that SQL should keep the shell space at the beginning of the

The 174th page, the space in SQL is not alone to hint, pit for a long time
13, the new library and Code script interoperability processing, need to change the table structure

175 page, Sign_event table structure is not changed, because the data source is missing the field "Updata_time", but the table structure this is "non-empty"
(sign_guest)
14, the new interface debugging process need to constantly clean the data (not mentioned in the book)

Don't try to run the tenth chapter right, if there is an error, there will be dirty data ... To clean up the database, nothing is mentioned in the book.
15, the data constantly error message "already exists"--New database activation problem, need to change the underlying configuration

Still the tenth chapter, again mentioning the problem of cleaning up the data, the cloned new database address is not associated with the local project, should be changed before the Django item
Purpose set, ie go '. /guest/settings ' Find ' DATABASES ' change configuration to ' NAME ': ' New database '. Add a marker, or remember to change it back
To.
16, the book Time data obsolete processing, need to adjust the data filled in the book

The tenth chapter of the framework of the Test_data, inside the event data, Start_time must be ahead of the advance.

------------------------Split Line, updated on 20180619,------------------------

Understanding and summary of the worm master's work "Web interface development and automation testing ... Python.. "Problem handling (continuous update ...) )

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.