FIX: use proper time format (activitypub/client) (#4132)
use proper http time format than replacing with GMT in time.RFC1123 =) Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4132 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com> Co-committed-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
This commit is contained in:
		
							parent
							
								
									ab95cc6726
								
							
						
					
					
						commit
						d6abb363f6
					
				
					 2 changed files with 9 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -11,6 +11,7 @@ import (
 | 
			
		|||
	"net/http/httptest"
 | 
			
		||||
	"regexp"
 | 
			
		||||
	"testing"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"code.gitea.io/gitea/models/db"
 | 
			
		||||
	"code.gitea.io/gitea/models/unittest"
 | 
			
		||||
| 
						 | 
				
			
			@ -23,6 +24,13 @@ import (
 | 
			
		|||
	_ "github.com/mattn/go-sqlite3"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func TestCurrentTime(t *testing.T) {
 | 
			
		||||
	date := CurrentTime()
 | 
			
		||||
	_, err := time.Parse(http.TimeFormat, date)
 | 
			
		||||
	assert.NoError(t, err)
 | 
			
		||||
	assert.Equal(t, date[len(date)-3:], "GMT")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* ToDo: Set Up tests for http get requests
 | 
			
		||||
 | 
			
		||||
Set up an expected response for GET on api with user-id = 1:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue