From a45f28f0ecd830c4e5683d46d6b454861ba912b3 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sun, 6 Mar 2022 10:08:05 +0000 Subject: [PATCH] Rewrote strip_tags test file to lorem ipsum. --- docs/conf.py | 6 +- docs/man/django-admin.1 | 8 +- docs/requirements.txt | 2 +- tests/utils_tests/files/strip_tags1.html | 2 +- tests/utils_tests/files/strip_tags2.txt | 125 +++++------------------ tests/utils_tests/test_html.py | 2 +- 6 files changed, 33 insertions(+), 112 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 578bb62627..2711eb9c89 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -94,8 +94,8 @@ source_suffix = ".txt" # The encoding of source files. # source_encoding = 'utf-8-sig' -# The root document. -root_doc = "contents" +# The master toctree document. +master_doc = "contents" # General substitutions. project = "Django" @@ -347,7 +347,7 @@ man_pages = [ # description, category, toctree_only) texinfo_documents = [ ( - root_doc, + master_doc, "django", "", "", diff --git a/docs/man/django-admin.1 b/docs/man/django-admin.1 index 74a03c872b..616eb780ae 100644 --- a/docs/man/django-admin.1 +++ b/docs/man/django-admin.1 @@ -870,9 +870,9 @@ If you\(aqre in a multi\-database setup, you might have fixture data that you want to load onto one database, but not onto another. In this situation, you can add a database identifier into the names of your fixtures. .sp -For example, if your \fBDATABASES\fP setting has a \(aqusers\(aq database -defined, name the fixture \fBmydata.users.json\fP or -\fBmydata.users.json.gz\fP and the fixture will only be loaded when you +For example, if your \fBDATABASES\fP setting has a \(aqmaster\(aq database +defined, name the fixture \fBmydata.master.json\fP or +\fBmydata.master.json.gz\fP and the fixture will only be loaded when you specify you want to load data into the \fBmaster\fP database. .SS Loading fixtures from \fBstdin\fP .sp @@ -1815,7 +1815,7 @@ zip files, you can use a URL like: .sp .nf .ft C -django\-admin startapp \-\-template=https://github.com/githubuser/django\-app\-template/archive/main.zip myapp +django\-admin startapp \-\-template=https://github.com/githubuser/django\-app\-template/archive/master.zip myapp .ft P .fi .UNINDENT diff --git a/docs/requirements.txt b/docs/requirements.txt index 408a6d7d44..6ea1372680 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,3 @@ pyenchant -Sphinx>=4.0.0 +Sphinx>=3.1.0 sphinxcontrib-spelling diff --git a/tests/utils_tests/files/strip_tags1.html b/tests/utils_tests/files/strip_tags1.html index fed6844774..476fc052aa 100644 --- a/tests/utils_tests/files/strip_tags1.html +++ b/tests/utils_tests/files/strip_tags1.html @@ -1289,7 +1289,7 @@
- Something went wrong with that request. Please try again. + Test string that has not been stripped.
diff --git a/tests/utils_tests/files/strip_tags2.txt b/tests/utils_tests/files/strip_tags2.txt index 6e458f7f91..2cbc6c5610 100644 --- a/tests/utils_tests/files/strip_tags2.txt +++ b/tests/utils_tests/files/strip_tags2.txt @@ -1,118 +1,39 @@ -_**Prerequisite**: You are already aware of the [basics of building a HelloWorld](http://developer.android.com/training/index.html) in Android and know [how to use the APIs provided in the support library](http://developer.android.com/training/basics/fragments/support-lib.html)._ +_**Lorem:** ipsum dolor sit [amet](https://example.com), consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et [dolore magna aliqua](https://example.com)._ -_The code example is available on [github](http://github.com/iontech/Fragments_Example "Fragments Example")._ +_Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea [commodo consequat](https://github.com)._ _____________________________________________________________ -Ever wanted a code snippet from an Activity to be available to other activities? Perhaps a Button or a ListView, maybe a Layout or any View/ViewGroup for that matter? Fragments let us do just that. +Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -Necessity is the mother of invention. -Before understanding what Fragments are and how they work, we must first realize their existence in the first place. +Volutpat +-------- +Volutpat est `velit` egestas (*egestas*) dui id ornare arcu odio ut. [*Non*](https://example.com) sodales neque `sodales`'s ut `etiam()`. -The Problem ------------ -Suppose we have an Android app with two Activities- [*FirstActivity*](https://github.com/iontech/Fragments_Example/blob/master/src/main/java/com/github/iontech/fragments_example/FirstActivity.java) and [*SecondActivity*](https://github.com/iontech/Fragments_Example/blob/master/src/main/java/com/github/iontech/fragments_example/SecondActivity.java). -*FirstActivity* contains two Views, a `TextView` (*textView*) and a `Button` (*button1*); and *button1* has an `onClick()` callback that `Toast`'s a simple message "Button pressed". -*SecondActivity* contains both the Views present in *FirstActivity* and a `Button` (*button2*). +1. Dignissim enim sit amet venenatis urna. +2. Scelerisque fermentum dui faucibus in ornare quam viverra orci. -Now we want to utilize the two layout components(Views) of *FirstActivity* in *SecondActivity*, we can go about this with two approaches: -1. Copy and Paste the xml elements of the two Views. -2. Create a separate layout for common Views and reuse it using `` layout element. - More about this [here](http://developer.android.com/training/improving-layouts/reusing-layouts.html). - -Electing the second approach makes sense cause it enables us to make reusable layouts. Everything seems great till now. We are able to make reusable layouts and use them as many times as we want. - -Now recollect that we have an `onClick()` callback assigned to *button1*. How do we reuse the same callback functionality of *button1* across multiple Activities? `` lets us reuse layouts and not the Activity source. -This is where Fragments come into play. - -Fragments +Tristique --------- -
![image](http://iontech.files.wordpress.com/2013/01/androidfragmentation1-264x300.png)
-Fragments encompass both layout resource and Java source. Hence, unlike ``, they allow us to reuse the View components along with their functionality, if needed. -Fragments were first introduced in Honeycomb(API 11), living under the `android.app` package. -**Note**: API 11 implies that Fragments have no support for devices less than Honeycomb and, for the record, as of writing this post, [more than 50% of Android devices worldwide run versions of Android below Honeycomb](http://developer.android.com/about/dashboards/index.html). Developer disappointed? You don't have to be, cause google has been cautious enough to add the Fragment APIs to the support library. Yay! -In the support library Fragment APIs sit in the `android.support.v4.app` package. This post assumes that your `minSdk` support is below API 11. Hence we concentrate on the Fragment APIs of the support library. +
![image](https://placekitten.com/200/200)
-### Diving into code +Tristique magna sit amet purus gravida quis blandit turpis. +**Note:** Rhoncus urna neque viverra justo nec. -Performing code reuse with Fragments involves three major steps: +### Fermentum dui faucibus -1. Creating reusable View components - Creating a layout for the fragment. -2. Creating reusable Java source - Writing the layout's corresponding Fragment class. -3. Employing the reusable components in Activity - Making an Activity to host this Fragment. +Fermentum dui faucibus in ornare quam viverra orci: -#### 1. Creating reusable View components -##### Creating a layout for the Fragment -This is done precisely as we do it for our activity layouts. The layout contains a root element (ViewGroup) defining the layout, For instance in our example we use a LinearLayout and its child elements(the reusable Views) that we want to have in our fragment. +1. Sed vulputate mi sit amet mauris commodo quis imperdiet. +2. Quisque non tellus orci ac. +3. Neque volutpat ac tincidunt vitae semper quis lectus. -> [fragment_common.xml](https://github.com/iontech/Fragments_Example/blob/master/res/layout/fragment_common.xml) +#### Aliquet eget sit amet tellus cras adipiscing enim eu. +##### Sodales ut etiam sit amet nisl purus in mollis nunc. +Interdum velit euismod in pellentesque massa placerat. Iaculis urna id volutpat lacus. Non consectetur a erat nam at lectus urna. Arcu non odio euismod lacinia at quis risus. Et pharetra pharetra massa massa ultricies mi. +> [Diam quis enim lobortis scelerisque.](https://example.com) + - - -